home *** CD-ROM | disk | FTP | other *** search
/ USA Bestseller / USA BESTSELLER Vol 1-95 (Hepp-Computer)(1995).iso / e004 / refman.doc < prev    next >
Text File  |  1994-10-12  |  1MB  |  23,806 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.                                         4DOS (r)
  12.  
  13.                                        4OS2 (tm)
  14.  
  15.                                   4DOS for Windows NT
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                                     Reference Manual
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.                                       Developed By
  29.                                 Rex Conn and Tom Rawson
  30.  
  31.                                     Documentation By
  32.                        Hardin Brothers, Tom Rawson, and Rex Conn
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.                                       Published By
  41.  
  42.                                     JP Software Inc.
  43.                                      P.O. Box 1470
  44.                                 East Arlington, MA 02174
  45.                                          U.S.A.
  46.  
  47.                                      (617) 646-3975
  48.                                    fax (617) 646-0904
  49.  
  50.  
  51.  
  52.  
  53.  
  54.                                   ACKNOWLEDGMENTS
  55.  
  56.  
  57.              We couldn't produce products like 4DOS, 4OS2, and 4DOS/NT
  58.              without the dedication and quality work of many people.  Our
  59.              thanks to:
  60.  
  61.                   JP Software Staff:  Mike Bessy, Bobby Kelley, Ellen
  62.                   Stone, Marcella Turner, Misty White.
  63.  
  64.                   Online Support:  Brian Miller and Tess Heder of Channel 1
  65.                   BBS; Don Watkins of CompuServe's IBMNET.
  66.  
  67.                   Beta Test Support:  David Moskowitz and the sysops of
  68.                   CompuServe's CONSULT forum.
  69.  
  70.                   Beta Testers:  We can't list all of our beta testers
  71.                   here!  A special thanks to all of you who helped make
  72.                   4DOS, 4OS2, and 4DOS/NT elegant, reliable, and friendly.
  73.  
  74.  
  75.              The following tools are used in creating and maintaining 4DOS,
  76.              4OS2, and 4DOS/NT:
  77.  
  78.                   Compilers:       Microsoft C, Microsoft Macro Assembler,
  79.                                    IBM C-Set/2, Borland Turbo Pascal
  80.                   Libraries:       Spontaneous Assembly (Base Two
  81.                                    Development), Turbo Professional (Turbo
  82.                                    Power Software)
  83.                   Editors:         Edix (Emerging Technology), Brief
  84.                                    (Solution Systems)
  85.                   Debuggers:       Periscope (The Periscope Company), Soft-
  86.                                    ICE (Nu-Mega Technologies)
  87.                   Version Control: PVCS (Sage Software)
  88.                   Documentation:   Microsoft Word for Windows with Adobe
  89.                                    Type Manager
  90.  
  91.  
  92.              Program and Documentation Copyright c 1988 - 1994, JP Software
  93.              Inc., All Rights Reserved.  4DOS is a registered trademark and
  94.              4OS2, JP Software, and the JP Software logo and product logos
  95.              are trademarks of JP Software Inc.  Other product and company
  96.              names are trademarks of their respective owners.
  97.  
  98.                                                                       10-94
  99.                                                                    CONTENTS
  100.         -------------------------------------------------------------------
  101.  
  102.  
  103.  
  104.         CONTENTS
  105.  
  106.         Introduction...............................................1
  107.             How to Use This Manual.................................2
  108.             Registration and Upgrade Information...................6
  109.             Technical Support......................................7
  110.  
  111.         Chapter 1 / General Concepts..............................10
  112.             Operating Systems and Command Processors..............10
  113.                 Primary and Secondary Shells......................12
  114.             Files and Directories.................................13
  115.                 Drives and Volumes................................14
  116.                 File Systems......................................14
  117.                 Directories and Subdirectories....................15
  118.                 File Names........................................16
  119.                 File Attributes...................................18
  120.             Internal and External Commands........................19
  121.             Executable Files and File Searches....................20
  122.             The Environment.......................................21
  123.             ASCII and Key Codes...................................22
  124.             The Keyboard..........................................23
  125.             Video.................................................24
  126.             ANSI Drivers..........................................25
  127.  
  128.         Chapter 2 / Conventions...................................26
  129.             Colors and Color Names................................26
  130.                 Blinking Text and Bright Background Colors........28
  131.             Color-Coded Directories...............................30
  132.             Keys and Key Names....................................31
  133.  
  134.         Chapter 3 / Using 4DOS, 4OS2, and 4DOS/NT.................34
  135.             At the Command Line...................................34
  136.                 Command-Line Editing..............................35
  137.                 Command History and Recall........................36
  138.                 Local and Global Command History..................39
  139.                 Command History Window............................40
  140.                 Filename Completion...............................41
  141.                 Filename Completion Window........................42
  142.                 Directory Changes and CDPATH......................43
  143.                 Directory History Window..........................45
  144.                 Local and Global Directory History................45
  145.                 Automatic Directory Changes.......................47
  146.                 Multiple Commands.................................47
  147.                 Temporarily Disabling Aliases.....................48
  148.                 Command Line Help.................................48
  149.                 Command-Line Length Limits........................50
  150.             Page and File Prompts................................ 50
  151.             Critical Errors.......................................51
  152.             Input and Output......................................52
  153.  
  154.         -------------------------------------------------------------------
  155.         Copr. 1994, JP Software Inc.      4DOS, 4OS2, 4DOS/NT Reference / i
  156.                                                                    CONTENTS
  157.         -------------------------------------------------------------------
  158.  
  159.  
  160.                 Redirection.......................................52
  161.                 Piping............................................55
  162.                 Keystack..........................................57
  163.             File Selection........................................58
  164.                 Extended Parent Directory Names...................59
  165.                 Wildcards.........................................59
  166.                 Date, Time, and Size Ranges.......................62
  167.                 Multiple Filenames................................66
  168.                 Include Lists.....................................67
  169.                 Executable Extensions.............................68
  170.             Advanced Features.....................................71
  171.                 Conditional Commands..............................71
  172.                 Command Grouping..................................71
  173.                 Escape Character..................................73
  174.             4DOS, 4OS2, and 4DOS/NT Compatibility.................74
  175.  
  176.         Chapter 4 / Aliases and Batch Files.......................77
  177.             Aliases...............................................77
  178.             Batch Files...........................................80
  179.                 .BAT, .CMD, and .BTM Files........................80
  180.                 Echoing...........................................81
  181.                 Batch File Parameters.............................81
  182.                 Batch File Commands...............................83
  183.                 Interrupting a Batch File.........................85
  184.                 Automatic Batch Files.............................85
  185.                 Detecting 4DOS, 4OS2, or 4DOS/NT..................86
  186.                 Using Aliases in Batch Files......................87
  187.                 Debugging Batch Files.............................89
  188.                 Batch File String Processing......................91
  189.                 Batch File Compression............................93
  190.                 REXX Support......................................95
  191.                 EXTPROC Support...................................96
  192.             Using the Environment.................................96
  193.                 Configuration Variables...........................98
  194.                 Internal Variables...............................100
  195.                 Variable Functions...............................108
  196.             Command Parsing......................................121
  197.                 Argument Quoting.................................123
  198.  
  199.         Chapter 5 / Configuration................................126
  200.             Using the .INI File..................................126
  201.             .INI File Directives.................................127
  202.                 Types of Directives..............................130
  203.                 Initialization Directives........................131
  204.                 Configuration Directives.........................136
  205.                 Color Directives.................................141
  206.                 Key Mapping Directives...........................143
  207.                 Advanced Directives..............................148
  208.                 Examples.........................................151
  209.  
  210.  
  211.  
  212.         -------------------------------------------------------------------
  213.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / ii
  214.                                                                    CONTENTS
  215.         -------------------------------------------------------------------
  216.  
  217.  
  218.         Chapter 6 / Command Reference Guide......................153
  219.             Command Categories...................................154
  220.             How to Use the Command Descriptions..................155
  221.             ?....................................................159
  222.             ACTIVATE.............................................160
  223.             ALIAS................................................161
  224.             ATTRIB...............................................173
  225.             BEEP.................................................176
  226.             BREAK................................................177
  227.             CALL.................................................179
  228.             CANCEL...............................................180
  229.             CD / CHDIR...........................................181
  230.             CDD..................................................183
  231.             CHCP.................................................184
  232.             CLS..................................................185
  233.             COLOR................................................186
  234.             COPY.................................................187
  235.             CTTY.................................................194
  236.             DATE.................................................195
  237.             DEL / ERASE..........................................196
  238.             DELAY................................................200
  239.             DESCRIBE.............................................201
  240.             DETACH...............................................203
  241.             DIR..................................................204
  242.             DIRS.................................................214
  243.             DO...................................................215
  244.             DPATH................................................218
  245.             DRAWBOX..............................................219
  246.             DRAWHLINE............................................221
  247.             DRAWVLINE............................................222
  248.             ECHO.................................................223
  249.             ECHOS................................................225
  250.             ENDLOCAL.............................................226
  251.             ESET.................................................227
  252.             EXCEPT...............................................229
  253.             EXIT.................................................231
  254.             FOR..................................................237
  255.             FREE.................................................242
  256.             GLOBAL...............................................243
  257.             GOSUB................................................245
  258.             GOTO.................................................246
  259.             HELP.................................................248
  260.             HISTORY..............................................249
  261.             IF...................................................251
  262.             IFF..................................................257
  263.             INKEY................................................259
  264.             INPUT................................................262
  265.             KEYBD................................................264
  266.             KEYS.................................................265
  267.             KEYSTACK.............................................266
  268.  
  269.         -------------------------------------------------------------------
  270.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / iii
  271.                                                                    CONTENTS
  272.         -------------------------------------------------------------------
  273.  
  274.  
  275.             LH / LOADHIGH........................................269
  276.             LIST.................................................272
  277.             LOADBTM..............................................276
  278.             LOG..................................................277
  279.             MD / MKDIR...........................................279
  280.             MEMORY...............................................280
  281.             MOVE.................................................282
  282.             MSGBOX...............................................287
  283.             ON...................................................288
  284.             PATH.................................................290
  285.             PAUSE................................................293
  286.             POPD.................................................294
  287.             PROMPT...............................................295
  288.             PUSHD................................................299
  289.             QUIT.................................................301
  290.             RD / RMDIR...........................................302
  291.             REBOOT...............................................303
  292.             REM..................................................305
  293.             REN / RENAME.........................................306
  294.             RETURN...............................................309
  295.             SCREEN...............................................310
  296.             SCRPUT...............................................312
  297.             SELECT...............................................313
  298.             SET..................................................319
  299.             SETDOS...............................................322
  300.             SETLOCAL.............................................329
  301.             SHIFT................................................330
  302.             START................................................331
  303.             SWAPPING.............................................339
  304.             TEE..................................................340
  305.             TEXT.................................................342
  306.             TIME.................................................343
  307.             TIMER................................................344
  308.             TITLE................................................346
  309.             TRUENAME.............................................347
  310.             TYPE.................................................348
  311.             UNALIAS..............................................350
  312.             UNSET................................................351
  313.             VER..................................................352
  314.             VERIFY...............................................353
  315.             VOL..................................................354
  316.             VSCRPUT..............................................355
  317.             WINDOW...............................................357
  318.             Y....................................................358
  319.  
  320.         Appendix A / Error Messages..............................359
  321.  
  322.         Appendix B / ASCII and Key Codes.........................371
  323.             Keys and Key Codes...................................375
  324.  
  325.  
  326.         -------------------------------------------------------------------
  327.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / iv
  328.                                                                    CONTENTS
  329.         -------------------------------------------------------------------
  330.  
  331.  
  332.         Glossary.................................................381
  333.  
  334.         Index....................................................393
  335.  
  336.         Quick Reference..........................................407
  337.             Internal Variables...................................407
  338.             Variable Functions...................................408
  339.             .INI File Directives.................................409
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.         -------------------------------------------------------------------
  384.         Copr. 1994, JP Software Inc.      4DOS, 4OS2, 4DOS/NT Reference / v
  385.                                                                    CONTENTS
  386.         -------------------------------------------------------------------
  387.  
  388.  
  389.  
  390.  
  391.         CONTACTING JP SOFTWARE
  392.  
  393.         You can contact JP Software at any of the following addresses.  Our
  394.         normal business hours are 9:00 AM to 5:00 PM weekdays, eastern US
  395.         time.  For more information about contacting us for technical
  396.         support, see page 7.
  397.  
  398.  
  399.              By mail:
  400.  
  401.                   JP Software Inc.
  402.                   P.O. Box 1470
  403.                   East Arlington, MA 02174
  404.                   USA
  405.  
  406.  
  407.              By telephone / fax:
  408.  
  409.                   Voice:         (617) 646-3975
  410.                   Fax:           (617) 646-0904
  411.                   Order Line:    (800) 368-8777 (orders only, USA only)
  412.  
  413.  
  414.              Electronically:
  415.  
  416.                   CompuServe:  Customer Service 75020,244
  417.                                Technical Support, GO JPSOFT or GO PCVENB
  418.                                (section 10), User ID 75300,1215
  419.                   Internet:    Customer Service 75020.244@compuserve.com
  420.                                Technical Support 75300.1215@compuserve.com
  421.                   BBS Support: Via Channel 1 BBS, Boston, 617-354-5776 at
  422.                                2,400 - 14,400 baud, no parity, 8 data
  423.                                bits, 1 stop bit
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.         -------------------------------------------------------------------
  441.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / vi
  442.                                                                INTRODUCTION
  443.         -------------------------------------------------------------------
  444.  
  445.  
  446.  
  447.         INTRODUCTION
  448.  
  449.  
  450.              Welcome to our Reference Manual.  We have designed this manual
  451.              to accompany three of our products:  4DOS, 4OS2, and 4DOS for
  452.              Windows NT.
  453.  
  454.              Technically, each of these programs is a command interpreter
  455.              or "shell." That means that they respond to the commands you
  456.              type at the C:\> or [C:\] prompt.  Each is designed to replace
  457.              the default command interpreter that was supplied with your
  458.              operating system:
  459.  
  460.                   4DOS      replaces  COMMAND.COM from DOS
  461.                   4OS2      replaces  CMD.EXE from OS/2
  462.                   4DOS/NT   replaces  CMD.EXE from Windows NT
  463.  
  464.              4DOS can also be used as the command interpreter for DOS
  465.              sessions running under OS/2, and under Windows 3.0 and above.
  466.  
  467.              Each of our products is highly compatible with the command
  468.              interpreter that it replaces.  That means that you don't have
  469.              to change your computing habits or unlearn anything to use any
  470.              of these products.  Each also adds many new features and
  471.              commands to its operating environment.  They make the
  472.              operating system friendlier, easier to use, and much more
  473.              powerful and versatile, without requiring you to learn a new
  474.              program, a new set of commands, or a new style of work.
  475.  
  476.              Each product is shipped with this manual plus a smaller
  477.              Introduction and Installation Guide.  Please start with the
  478.              smaller manual.  It will tell you how to get started with the
  479.              product you purchased and also contains some other information
  480.              that applies specifically to that product.
  481.  
  482.              Once you have installed 4DOS, 4OS2, or 4DOS for Windows NT,
  483.              you can learn its features at your own pace.  Relax, enjoy the
  484.              power of your new program, and browse through both manuals
  485.              occasionally.  Press the F1 key whenever you need help.  The
  486.              program will soon become an essential part of your computer,
  487.              and you'll wonder how you ever got along without it.
  488.  
  489.              If you are a new user and want to take your new program for a
  490.              spin without performing a complete installation, see the
  491.              Guided Tour pamphlet included with your copy of 4DOS, 4OS2, or
  492.              4DOS/NT.
  493.  
  494.              We are constantly working to improve these programs.  If you
  495.              have suggestions for features or commands that you think we
  496.  
  497.         -------------------------------------------------------------------
  498.         Copr. 1994, JP Software Inc.      4DOS, 4OS2, 4DOS/NT Reference / 1
  499.                                                                INTRODUCTION
  500.         -------------------------------------------------------------------
  501.  
  502.  
  503.              should include in the next version, or any other way we could
  504.              improve our product, please let us know.  Many of the
  505.              improvements in this version were suggested by our users, and
  506.              while we can't promise to include every suggested feature, we
  507.              really do appreciate and pay attention to your comments.
  508.  
  509.  
  510.         How to Use This Manual
  511.  
  512.              This manual covers three separate products:  4DOS, 4OS2, and
  513.              4DOS for Windows NT.  We have combined reference information
  514.              for the products in one manual because 4DOS, 4OS2, and 4DOS
  515.              for Windows NT offer almost exactly the same features and
  516.              commands, so individual manuals would be almost identical.
  517.              Many of our customers use more than one of these products;
  518.              they find that a single manual helps them understand the
  519.              similarities and differences of the three products.  In
  520.              addition, printing a single manual reduces our costs and lets
  521.              us bring you the most powerful command interpreters available
  522.              for the lowest possible price.
  523.  
  524.              Most of this manual describes commands and features which are
  525.              available in all three products.  When we need to discuss the
  526.              features or behavior of a single product, we mention it
  527.              specifically in the text.  When an entire paragraph or section
  528.              applies to a specific product, we use marginal text to
  529.              identify that product:
  530.  
  531.     4DOS     marks sections that apply only to 4DOS.
  532.  
  533.     4OS2     marks sections that apply only to 4OS2.
  534.  
  535.     4NT      marks sections that apply only to 4DOS for Windows NT.  For
  536.              brevity, we often refer to this product as "4DOS/NT", or by
  537.              the actual program name, "4NT", in this manual.
  538.  
  539.              Occasionally, a feature will be marked with two of these
  540.              marginal notations when it applies to two different products.
  541.  
  542.              We have designed this manual to serve as a gentle introduction
  543.              to our products for novice users and as a reference manual for
  544.              advanced users.
  545.  
  546.              You will likely find some parts of the manual too simple or
  547.              too technical for your tastes.  Unless you are convinced that
  548.              one of those sections holds just the information you need for
  549.              a specific task, feel free to skip to the next part of the
  550.              manual that is more to your liking.  You can use almost every
  551.              feature of our products without having to worry about other
  552.              features or commands.
  553.  
  554.         -------------------------------------------------------------------
  555.         Copr. 1994, JP Software Inc.      4DOS, 4OS2, 4DOS/NT Reference / 2
  556.                                                                INTRODUCTION
  557.         -------------------------------------------------------------------
  558.  
  559.  
  560.              As you read the manual, you will occasionally see an
  561.              exclamation point [!] next to a paragraph.  The exclamation
  562.              point means that that paragraph contains a caution or warning
  563.              you should observe when using the feature it discusses.
  564.  
  565.              You will also see the symbol ## next to certain paragraphs.
  566.              This indicates an in-depth discussion or a more advanced topic
  567.              which you can skip if you wish to stick with the basics.  Come
  568.              back to this topic later for more details, or if you're having
  569.              trouble with the particular issue it discusses.  If you see
  570.              the ## next to a section heading, it means the entire section
  571.              contains such information.
  572.  
  573.              You may find the information in such marked sections useful
  574.              even if you're relatively new to computers or to our products.
  575.              However, you can also skip the marked section and still
  576.              understand and use the basic topic of the larger section
  577.              you're reading.
  578.  
  579.              This manual is divided into six chapters and two appendices,
  580.              plus a glossary and index.  Here's a brief overview of what
  581.              you'll find in each:
  582.  
  583.  
  584.              Chapter 1 / General Concepts
  585.  
  586.                   This chapter is an introduction to several terms and
  587.                   concepts that we use throughout the manual.  If you're a
  588.                   novice, you might want to browse through the entire
  589.                   chapter.  If you're a power user and all of the topics in
  590.                   this chapter seem simple, then go on to the next chapter.
  591.                   If you think you need to brush up a bit on the basics of
  592.                   a couple of terms and ideas, you'll probably find them
  593.                   here.
  594.  
  595.  
  596.              Chapter 2 / Conventions and Restrictions
  597.  
  598.                   This chapter contains information about three conventions
  599.                   that are used throughout 4DOS, 4OS2, and 4DOS/NT:  colors
  600.                   and color names, color-coded directories, and keys and
  601.                   key names.  You'll find many references in the manual to
  602.                   the information in this chapter.  You may choose to read
  603.                   through this chapter to see what is available, or refer
  604.                   to the topics here when you come to a cross reference
  605.                   later in the manual.
  606.  
  607.  
  608.  
  609.  
  610.  
  611.         -------------------------------------------------------------------
  612.         Copr. 1994, JP Software Inc.      4DOS, 4OS2, 4DOS/NT Reference / 3
  613.                                                                INTRODUCTION
  614.         -------------------------------------------------------------------
  615.  
  616.  
  617.              Chapter 3 / Using 4DOS, 4OS2, and 4DOS/NT
  618.  
  619.                   This chapter is for everyone.  It contains a description
  620.                   of 4DOS, 4OS2, and 4DOS/NT features, and lots of examples
  621.                   to help you learn to use each one.  Even if you are a
  622.                   novice user and want to ignore some of these features
  623.                   until later, skim through this chapter to get an idea of
  624.                   what is available and where to find the information that
  625.                   you will eventually want.  Our products offer both
  626.                   features which are not related to specific commands, and
  627.                   a complete set of over 80 internal commands.  This
  628.                   chapter has complete reference information on most of the
  629.                   non-command features.  Reference information on commands
  630.                   is in Chapter 6.
  631.  
  632.  
  633.              Chapter 4 / Aliases and Batch Files
  634.  
  635.                   This chapter introduces two of the most powerful features
  636.                   in 4DOS, 4OS2, and 4DOS/NT:  Aliases and Batch Files.
  637.                   You can use both to automate much of your computing work.
  638.                   Even if you are a novice user, you should skim through
  639.                   this chapter to see what is available.  This chapter also
  640.                   contains information about using environment variables,
  641.                   and the internal variables and variable functions that
  642.                   make aliases and batch files extremely powerful and
  643.                   flexible.
  644.  
  645.  
  646.              Chapter 5 / Configuration
  647.  
  648.                   This chapter is for advanced users who want to be sure
  649.                   that 4DOS, 4OS2, or 4DOS/NT is running at top efficiency
  650.                   on their systems.  It includes detailed information on
  651.                   setting up your command processor and on changing its
  652.                   configuration.
  653.  
  654.  
  655.              Chapter 6 / Command Reference
  656.  
  657.                   Each of our products offers over 80 internal commands.
  658.                   This chapter explains the purpose of each command and
  659.                   tells you how to use it.  It has examples that will help
  660.                   you learn each command and the technical details you will
  661.                   need to get the command to behave exactly as you wish.
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.         -------------------------------------------------------------------
  669.         Copr. 1994, JP Software Inc.      4DOS, 4OS2, 4DOS/NT Reference / 4
  670.                                                                INTRODUCTION
  671.         -------------------------------------------------------------------
  672.  
  673.  
  674.              Appendices
  675.  
  676.                   We've included some helpful tables here, as well as
  677.                   information for those who like to know technical details.
  678.                   There are two appendices.
  679.  
  680.                   Appendix A lists all error messages.  Look here if you
  681.                   need an explanation of an error message, or if you aren't
  682.                   sure if the message came from 4DOS, 4OS2, or 4DOS/NT.
  683.  
  684.                   Appendix B lists codes for the ASCII character set (your
  685.                   computer's internal method for representing letters,
  686.                   digits, and other characters) and for the keys on your
  687.                   keyboard.  These codes can be useful with certain
  688.                   commands.
  689.  
  690.  
  691.              Glossary
  692.  
  693.                   If you need help with any of the terminology in this
  694.                   manual, look here.
  695.  
  696.  
  697.              Index
  698.  
  699.                   If you can't find the information you need, this should
  700.                   help you find it.
  701.  
  702.  
  703.              Quick Reference
  704.  
  705.                   This quick index will give you the page number for
  706.                   detailed information on each internal variable, variable
  707.                   funtion, and .INI file directive.
  708.  
  709.  
  710.              Additional Files
  711.  
  712.                   Files distributed with 4DOS, 4OS2, and 4DOS/NT cover
  713.                   important additional information beyond what's included
  714.                   in this manual.  README.DOC contains general notes,
  715.                   highlights of the latest release, and brief installation
  716.                   instructions for those upgrading from a downloaded copy
  717.                   of 4DOS, 4OS2, or 4DOS/NT.  MANMOD.DOC covers changes or
  718.                   corrections in the manual, if any, and UPDATxxx.DOC
  719.                   contains detailed information for users with older
  720.                   versions on what has changed in the latest release ("xxx"
  721.                   is the version number).  For 4DOS users we also include
  722.                   APPNOTES.DOC, which contains application notes for a
  723.  
  724.  
  725.         -------------------------------------------------------------------
  726.         Copr. 1994, JP Software Inc.      4DOS, 4OS2, 4DOS/NT Reference / 5
  727.                                                                INTRODUCTION
  728.         -------------------------------------------------------------------
  729.  
  730.  
  731.                   variety of other software packages to help you use those
  732.                   packages with 4DOS.
  733.  
  734.  
  735.         Registration and Upgrade Information
  736.  
  737.              If you purchased 4DOS, 4OS2, or 4DOS/NT from a software
  738.              dealer, your copy came with a registration card.  Please fill
  739.              out this card and return it promptly to JP Software.  It
  740.              ensures that we have a record of your registration so that we
  741.              can give you ongoing technical support and notices of
  742.              upgrades.  If you purchased 4DOS, 4OS2, or 4DOS/NT directly
  743.              from JP Software, you are already registered and no
  744.              registration card is necessary.
  745.  
  746.              Once you are a registered user, you will receive:
  747.  
  748.                   * A subscription to The Prompt Solution, JP Software's
  749.                     customer newsletter.  The Prompt Solution includes
  750.                     tips for using 4DOS, 4OS2, and 4DOS/NT; notification
  751.                     of upgrades; and information about other products from
  752.                     JP Software.
  753.  
  754.                   * Technical support via electronic mail, fax, mail, or
  755.                     telephone.
  756.  
  757.                   * A downloadable upgrade to the next version of 4DOS;
  758.                     see below for details.
  759.  
  760.              4DOS, 4OS2, and 4DOS/NT are upgraded regularly through
  761.              maintenance releases, designed to fix minor problems or
  762.              improve compatibility, and major upgrades which contain
  763.              enhancements and additional features.  Maintenance releases
  764.              are identified by a change in the hundredths digit of the
  765.              version number, for example from 5.0 to 5.01 or 5.02.  Major
  766.              upgrades are identified by a change in the tenths digit or
  767.              "ones" digit, for example from 5.0 to 5.1 or 6.0.
  768.  
  769.              Major upgrades can be purchased from JP Software or your
  770.              dealer for a modest charge.  For most users the first major
  771.              upgrade released after your initial purchase is available at
  772.              no charge if you download it from one of our support areas
  773.              (see below).  You can also download maintenance releases from
  774.              one of the support areas, or order them on disk at a nominal
  775.              cost.
  776.  
  777.              As a registered user, you will automatically be notified when
  778.              a major upgrade is released.  We don't send out notices when
  779.              maintenance releases become available, because you don't
  780.              usually need them unless you're having a problem.  If you call
  781.  
  782.         -------------------------------------------------------------------
  783.         Copr. 1994, JP Software Inc.      4DOS, 4OS2, 4DOS/NT Reference / 6
  784.                                                                INTRODUCTION
  785.         -------------------------------------------------------------------
  786.  
  787.  
  788.              with a problem that's been addressed in a maintenance release,
  789.              we'll mail you a copy on disk or assist you in downloading it.
  790.  
  791.              As a registered user, you can download maintenance releases
  792.              and your first major upgrade from the JP Software support area
  793.              on CompuServe (GO PCVENB, library 10), or Channel 1 (see
  794.              below).  If you are familiar with the Internet, you can also
  795.              obtain JP Software files via anonymous ftp from the 4DOS
  796.              directory on simtel20 or any of its mirrors.
  797.  
  798.              The file names used for updates vary from time to time
  799.              depending on the extent of the changes made, but typically
  800.              will look like 4DOS5*.ZIP, 4OS22*.ZIP, etc.  The "*" refers to
  801.              one or more characters further identifying the file.  .ZIP
  802.              files are "archives" which contain many other files within
  803.              them.  The files stored inside the .ZIP file are compressed
  804.              for more efficient downloads.  To decompress the .ZIP file and
  805.              gain access to the actual 4DOS, 4OS2, or 4DOS/NT files you
  806.              will need the PKUNZIP program or an equivalent.  Such programs
  807.              are available from the same source as the .ZIP files
  808.              themselves.  Check the directory listings and file
  809.              descriptions on the service you are using to identify the
  810.              files you need.
  811.  
  812.              Downloads are also available from many other local bulletin
  813.              boards and online services.  Lists of download locations,
  814.              including bulletin boards outside the USA, are published from
  815.              time to time in The Prompt Solution and are included in the
  816.              SUPPORT.BBS file that comes with each product.
  817.  
  818.              We offer BBS support through Channel 1 in Boston, one of the
  819.              largest and best-run bulletin boards in the US.  Channel 1 is
  820.              an independent bulletin board and is not owned or operated by
  821.              JP Software.  To access Channel 1 set your modem to any speed
  822.              from 2,400 to 14,400 baud, no parity, 8 data bits, and 1 stop
  823.              bit, and dial 617-354-5776.  Join conference 5 for 4DOS
  824.              downloads.  You can leave support messages and download files
  825.              at no charge, but if you want to use any of Channel 1's other
  826.              excellent services you may need to purchase a membership to
  827.              have sufficient online time.
  828.  
  829.  
  830.         Technical Support
  831.  
  832.              Technical support is available via public electronic support
  833.              conferences, private electronic mail, telephone, fax, and
  834.              mail.  When you contact us for support please give us your
  835.              serial number so that we can verify your status as a customer,
  836.              keep track of your inquiry, and contact you if necessary.
  837.  
  838.  
  839.         -------------------------------------------------------------------
  840.         Copr. 1994, JP Software Inc.      4DOS, 4OS2, 4DOS/NT Reference / 7
  841.                                                                INTRODUCTION
  842.         -------------------------------------------------------------------
  843.  
  844.  
  845.              Often the best way to contact us for support is in one of the
  846.              following public electronic support conferences.  The numbers
  847.              in parentheses indicate the usual delay, in business days, to
  848.              receive a reply to a message.
  849.  
  850.              CompuServe / ZiffNet:  Primary support is via the JP Software
  851.              section of the CompuServe PCVENB forum (GO JPSOFT or GO
  852.              PCVENB, section 10, "JP Software") (1 day).
  853.  
  854.              Bulletin Boards:  Primary support is via the Channel 1 BBS,
  855.              Boston, MA (1 - 3 days; see above for access details).
  856.              Messages may be left in any of the 4DOS conferences; check the
  857.              online list for exact conference numbers.  Support is also
  858.              available from many local BBSes via the 4DOS conferences on
  859.              the RIME, ILink, SmartNet, and FidoNet BBS Networks (3-5
  860.              days).
  861.  
  862.              To contact JP Software for support by mail, telephone, fax, or
  863.              electronic mail, see our addresses and phone numbers on page
  864.              vi of this manual.             
  865.  
  866.              If you call for support and no technical support
  867.              representative is available, we will do our best to return
  868.              your call within 24 hours (weekends and holidays excluded).
  869.              If your problem is urgent and requires a faster response,
  870.              please let us know and we will try to accommodate you.  If you
  871.              contact us by telephone and don't receive a reply within 24
  872.              hours, please try again.  We may have tried to return your
  873.              call and been unable to reach you.
  874.  
  875.              Before contacting us for support, please check the manuals and
  876.              other documentation for answers to your question.  If you
  877.              can't find what you need, try the Index.  If you're having
  878.              trouble getting 4DOS, 4OS2, or 4DOS/NT to run properly, either
  879.              alone or with your particular hardware or software, see the
  880.              Introduction and Installation Guide, and (for 4DOS) the
  881.              APPNOTES.DOC file on your disk.  Also look through the
  882.              README.DOC and UPDATxxx.DOC files, as they may contain updates
  883.              to this manual or other important information ("xxx" is the
  884.              version number).
  885.  
  886.              If you do need to contact us for support, it helps if you can
  887.              give us some basic information:
  888.  
  889.                   * What exactly did you do?  A concise description of
  890.                     what steps you must take to make the problem appear is
  891.                     much more useful than a long analysis of what might be
  892.                     happening.
  893.  
  894.  
  895.  
  896.         -------------------------------------------------------------------
  897.         Copr. 1994, JP Software Inc.      4DOS, 4OS2, 4DOS/NT Reference / 8
  898.                                                                INTRODUCTION
  899.         -------------------------------------------------------------------
  900.  
  901.  
  902.                   * What went wrong?  At what point did the failure occur?
  903.                     If you saw an error message or other important or
  904.                     unusual information on the screen, what exactly did it
  905.                     say?
  906.  
  907.                   * Briefly, what techniques did you use to try to resolve
  908.                     the problem?  What results did you get?
  909.  
  910.                   * What computer and operating system are you using?
  911.  
  912.                   * Are you running a network, or using a particular
  913.                     operating environment (such as DESQview or Windows)?
  914.  
  915.                   * What are the contents of any startup files you use
  916.                     (such as CONFIG.SYS, AUTOEXEC.BAT, 4START, 4EXIT, and
  917.                     the .INI file), any batch files they call, and any
  918.                     alias or environment variable files they load?
  919.  
  920.                   * Can you repeat the problem or does it occur randomly?
  921.                     If it's random, does it seem related to the programs
  922.                     you're using when the problem occurs?
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.         -------------------------------------------------------------------
  954.         Copr. 1994, JP Software Inc.      4DOS, 4OS2, 4DOS/NT Reference / 9
  955.                                                CHAPTER 1 / GENERAL CONCEPTS
  956.         -------------------------------------------------------------------
  957.  
  958.  
  959.  
  960.         CHAPTER 1 / GENERAL CONCEPTS
  961.  
  962.  
  963.         You can start using 4DOS, 4OS2, or 4DOS/NT as soon as you finish
  964.         installing it, because each of our products is compatible with the
  965.         traditional commands you're used to.  But most users find that the
  966.         more they know about their computer systems, the more power they
  967.         get from our products.  And, the more experience they gain, the
  968.         more they want to know about their computer system as a whole.
  969.  
  970.         This section of the manual explains some fundamental concepts about
  971.         your computer, operating system, and 4DOS, 4OS2, and 4DOS/NT.  It
  972.         should help you understand the terms and concepts in the pages that
  973.         follow.  If you find some of the concepts overwhelming, just
  974.         remember that they are here when you need them.  If you find this
  975.         material too simple, skim over the topics and then go on to the
  976.         next section.  Each topic in this chapter is independent, so if you
  977.         read it straight through you won't necessarily find a natural
  978.         "flow" from one topic to another.
  979.  
  980.         If you come across terms or concepts in this chapter that you are
  981.         unsure about, refer to the Glossary on page 381 or the Index.
  982.  
  983.  
  984.         Operating Systems and Command Processors
  985.  
  986.              This section explains briefly what an operating system is,
  987.              what a command processor is, and how the command processor
  988.              works under DOS, OS/2, and Windows NT.
  989.  
  990.              An operating system is nothing more than a collection of
  991.              software.  However, unlike application software, which
  992.              performs a specific, user-oriented task (such as creating and
  993.              printing documents, or performing calculations on rows and
  994.              columns of numbers), operating system software is designed to
  995.              perform some special functions.  The operating system
  996.              typically:
  997.  
  998.                   * Starts the computer system.  The operating system is
  999.                     the first software loaded when you turn on the
  1000.                     computer.
  1001.  
  1002.                   * Provides services to other software.  These include
  1003.                     basic file access, assignment of your computer's
  1004.                     memory for use by different programs, and the control
  1005.                     of hardware devices like the keyboard, display,
  1006.                     printer, and serial ports.
  1007.  
  1008.  
  1009.  
  1010.         -------------------------------------------------------------------
  1011.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 10
  1012.                                                CHAPTER 1 / GENERAL CONCEPTS
  1013.         -------------------------------------------------------------------
  1014.  
  1015.  
  1016.                   * Ensures that programs don't interfere with each other
  1017.                     while they are running.
  1018.  
  1019.                   * Provides a way for you to start programs to do your
  1020.                     work.
  1021.  
  1022.                   * Includes utilities to control and manage your system,
  1023.                     for example to organize disks and files, display
  1024.                     status information, or adjust your system for
  1025.                     international conventions.
  1026.  
  1027.              More complex operating systems may include many more
  1028.              functions, such as built-in network connections, the ability
  1029.              to switch rapidly between many tasks, support for high-quality
  1030.              sound output, and so on.
  1031.  
  1032.              Our products run under the DOS, OS/2, and Windows NT operating
  1033.              systems.
  1034.  
  1035.              Each of these operating systems includes a command processor:
  1036.              a program that accepts your instructions and carries them out.
  1037.              The basic operation of a command processor is very simple:  It
  1038.              prompts you for a command, you type in the command, the
  1039.              command processor executes it, and the cycle repeats.  This
  1040.              sometimes called a "command line" interface, because commands
  1041.              are typically executed line by line.
  1042.  
  1043.              Under DOS, the command-line interface is the only way to tell
  1044.              the operating system what you want it to do.  OS/2 and Windows
  1045.              NT each include a graphical user interface that is intended to
  1046.              replace the command line as the primary method for providing
  1047.              instructions to the operating system.  However, most OS/2 and
  1048.              Windows NT users find that the command line is required for
  1049.              some tasks, and much more efficient for many others.  They
  1050.              therefore use both the graphical interface and the command
  1051.              line, depending on the task at hand.
  1052.  
  1053.              The command processor shipped with DOS is called COMMAND.COM.
  1054.              The command processors shipped with OS/2 and Windows NT are
  1055.              both called CMD.EXE.
  1056.  
  1057.              When you install 4DOS, 4DOS.COM replaces COMMAND.COM as your
  1058.              command processor.  4OS2 replaces the OS/2 version of CMD.EXE
  1059.              with 4OS2.EXE, and 4DOS/NT replaces the Windows NT version of
  1060.              CMD.EXE with 4NT.EXE.  All of these command processors are
  1061.              normal programs that know how to translate your commands into
  1062.              actions.  4DOS, 4OS2, and 4DOS/NT are simply much more
  1063.              powerful command processors than those supplied with each
  1064.              operating system.
  1065.  
  1066.  
  1067.         -------------------------------------------------------------------
  1068.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 11
  1069.                                                CHAPTER 1 / GENERAL CONCEPTS
  1070.         -------------------------------------------------------------------
  1071.  
  1072.  
  1073.     4DOS     Under DOS, the command processor is started automatically at
  1074.              the end of the boot process.  If you don't want to use
  1075.              COMMAND.COM as your command processor, you use the SHELL
  1076.              statement in CONFIG.SYS to specify a different command
  1077.              processor.
  1078.  
  1079.     4OS2     Under OS/2, the command processor is started whenever you
  1080.              select the appropriate object on your OS/2 desktop.  If you
  1081.              don't want to use CMD.EXE as your command processor, you use
  1082.              the SET OS2_SHELL statement in CONFIG.SYS to specify a
  1083.              different command processor.  Because OS/2 includes the
  1084.              ability to run DOS programs, it also includes a copy of
  1085.              COMMAND.COM as its default DOS command processor.  You can
  1086.              change to a different DOS command processor with the SHELL
  1087.              statement in the OS/2 CONFIG.SYS file.
  1088.  
  1089.     4NT      Under Windows NT, there is no CONFIG.SYS file, and no special
  1090.              way to specify a default command processor.  Instead, you
  1091.              simply create a desktop object for any command processor you
  1092.              want to use.
  1093.  
  1094.  
  1095.              Primary and Secondary Shells
  1096.  
  1097.              Technically, the command processor is a shell:  a program that
  1098.              understands your commands and makes the correct calls to the
  1099.              underlying operating system to perform various tasks,
  1100.              including running programs.
  1101.  
  1102.     4DOS     Under DOS, the command processor that runs when the computer
  1103.              boots up, or when an OS/2 DOS session starts, is called the
  1104.              primary shell.
  1105.  
  1106.              Any command processor that is started as a "child" to a
  1107.              primary shell is a secondary shell.  Typically, secondary
  1108.              shells are started by application programs with a "shell to
  1109.              the command prompt" feature, and by multitasking environments
  1110.              like Windows or DESQView.  A secondary shell has most of the
  1111.              same features as a primary shell.
  1112.  
  1113.              There are a few differences between primary and secondary
  1114.              shells under DOS.  Generally, less memory is available when a
  1115.              secondary shell is running, because at least part of the
  1116.              program that started it is still in memory waiting to spring
  1117.              back to life when you exit.  And normally only the primary
  1118.              shell automatically executes the instructions in your
  1119.              AUTOEXEC.BAT file.
  1120.  
  1121.              Under DOS you can leave a secondary shell with the EXIT
  1122.              command, but there is normally no way to exit from the primary
  1123.  
  1124.         -------------------------------------------------------------------
  1125.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 12
  1126.                                                CHAPTER 1 / GENERAL CONCEPTS
  1127.         -------------------------------------------------------------------
  1128.  
  1129.  
  1130.              shell, because DOS requires a shell present to operate.
  1131.              However, if you are running 4DOS in a DOS session under OS/2
  1132.              version 2.0 or later you can use EXIT in the primary DOS shell
  1133.              to close the session and return to the OS/2 desktop.
  1134.  
  1135.     4OS2,    Under OS/2 and Windows NT, each 4OS2 or 4DOS/NT session that
  1136.     4NT      is started from the desktop is a primary shell.  Secondary
  1137.              shells are started by applications with a "shell to the
  1138.              command prompt" feature, and are also used for a special kind
  1139.              of communication between programs called a pipe (see page 55).
  1140.  
  1141.              Under 4OS2 and 4DOS/NT, you can exit from both primary and
  1142.              secondary shells.  When you exit from a primary shell, the
  1143.              command processor session is closed and you are returned to
  1144.              the desktop.
  1145.  
  1146.              You may also see the term shell used to describe programs
  1147.              which assist you in managing your files (for example XTree or
  1148.              Lotus Magellan for DOS, or Norton Commander for OS/2).  This
  1149.              is a different and less precise meaning of "shell" than the
  1150.              one used above and elsewhere in this manual.  Such programs
  1151.              are also sometimes called "visual shells" because they use a
  1152.              menu or graphical interface to receive commands.  Unlike 4DOS,
  1153.              4OS2, and 4DOS/NT, these programs are not command processors,
  1154.              and cannot replace COMMAND.COM or CMD.EXE.
  1155.  
  1156.              Each time 4DOS, 4OS2, or 4DOS/NT starts as either a primary or
  1157.              secondary shell, it looks for and executes one or more
  1158.              "automatic" batch files.  These files are explained on page
  1159.                .             85
  1160.  
  1161.  
  1162.         Files and Directories
  1163.  
  1164.              You may have dozens, hundreds, or thousands of files stored on
  1165.              your computer's disks.  Your operating system is responsible
  1166.              for managing all of these files.  In order to do so, it uses a
  1167.              unique name to locate each file in much the same way that the
  1168.              post office assigns a unique address to every residence.
  1169.  
  1170.              The unique name of any file is composed of a drive letter, a
  1171.              directory path, and a filename.  Each of these parts of the
  1172.              file's name is case insensitive; you can mix upper and lower
  1173.              case letters in any way you wish.
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.         -------------------------------------------------------------------
  1181.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 13
  1182.                                                CHAPTER 1 / GENERAL CONCEPTS
  1183.         -------------------------------------------------------------------
  1184.  
  1185.  
  1186.              Drives and Volumes
  1187.  
  1188.              A drive letter designates which drive contains the file.  In a
  1189.              file's full name, the drive letter is followed by a colon.
  1190.              Drive letters A: and B: are normally reserved for the floppy
  1191.              disk drives.  (Systems with a single drive use both A: and B:
  1192.              for that drive.  The operating system asks you to swap
  1193.              diskettes as necessary to turn that single physical drive into
  1194.              two separate logical disk drives.)
  1195.  
  1196.              Normally, drive C: is the first (or only) hard disk drive.
  1197.              Later versions of DOS, some DOS-based utility programs, and
  1198.              both OS/2 and Windows NT can divide a large hard disk into
  1199.              multiple logical drives or volumes that are usually called C:,
  1200.              D:, E:, etc.  Also, the DOS and Windows NT utility SUBST lets
  1201.              you use drive letters as a substitute for directory names.
  1202.              Many network systems (LANs) use a similar feature to give
  1203.              drive letters to sections of the network file server drives.
  1204.  
  1205.              Some computers also have "RAM disks" (sometimes called
  1206.              "virtual disks"), which are areas of memory set aside by
  1207.              software (a "RAM disk driver") for use as fast but temporary
  1208.              storage.  RAM disks are also assigned drive letters, typically
  1209.              using letters beyond that used by the last hard disk in the
  1210.              system, but before any network drives.  For example, on a
  1211.              system with a large hard disk you might have A: and B: as
  1212.              floppy drives, C:, D:, and E: as parts of the hard disk, F: as
  1213.              a RAM disk, and G: and H: as network drives.
  1214.  
  1215.  
  1216.              File Systems
  1217.  
  1218.              Each disk volume is organized according to a file system.  The
  1219.              file system determines how files are named and how they are
  1220.              organized on the disk.  The DOS file system uses a File
  1221.              Allocation Table or FAT to keep track of each file, and
  1222.              therefore it is often called a FAT file system.  Both OS/2 and
  1223.              Windows NT also include support for the traditional FAT file
  1224.              system.
  1225.  
  1226.              OS/2 also supports the High Performance File System or HPFS.
  1227.              Windows NT can work with HPFS disk volumes plus volumes
  1228.              formatted with its own file system, which is called NTFS.
  1229.  
  1230.              The file system type (FAT, HPFS, or NTFS) is determined when a
  1231.              hard disk volume is formatted and applies to the entire
  1232.              volume.  For example, you might have a 200 MB hard disk
  1233.              divided into four 50 MB volumes, with the first three volumes
  1234.              (C:, D:, and E:) formatted for the FAT file system, and the
  1235.              fourth formatted for HPFS or NTFS.
  1236.  
  1237.         -------------------------------------------------------------------
  1238.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 14
  1239.                                                CHAPTER 1 / GENERAL CONCEPTS
  1240.         -------------------------------------------------------------------
  1241.  
  1242.  
  1243.              When you are using DOS, only files on FAT volumes are visible
  1244.              and available.  HPFS and NTFS volumes are completely
  1245.              inaccessible.  If you boot your system under OS/2, you can
  1246.              access FAT and HPFS volumes, both from OS/2 itself and from
  1247.              DOS sessions running under OS/2 (DOS sessions can only access
  1248.              files with FAT-compatible names; see page 17 for details).  If
  1249.              you boot under Windows NT, you can access FAT, HPFS, and NTFS
  1250.              volumes.
  1251.  
  1252.      4NT     Files on an NTFS volume have both a "long" and a "short" or FAT-    
  1253.              compatible file name.  You can view the short file name with
  1254.              the DIR /X command.  If you use 4DOS/NT to COPY or MOVE files
  1255.              from an NTFS volume to a FAT volume, the files will saved with
  1256.              their short, FAT-compatible names. Beginning with version 3.5,
  1257.              Windows NT  supports the use of long filenames even on FAT
  1258.              drives; see page 18 for additional details.
  1259.  
  1260.     4OS2     Finally, OS/2 also supports installable file systems, which
  1261.              are installed with the IFS= directive in the OS/2 CONFIG.SYS
  1262.              file.  The CD-ROM file system supplied with OS/2 2.x is an
  1263.              example of an installable file system, and many OS/2 networks
  1264.              are also implemented as installable file systems.
  1265.  
  1266.  
  1267.              Directories and Subdirectories
  1268.  
  1269.              A file system is a method of organizing all of the files on an
  1270.              entire disk or hard disk volume.  Directories are used to
  1271.              divide the files on a disk into logical groups that are easy
  1272.              to work with.  Their purpose is similar to the use of file
  1273.              drawers to contain groups of hanging folders, hanging folders
  1274.              to contain smaller manila folders, and so on.
  1275.  
  1276.              Every drive has a root or base directory, and many have one or
  1277.              more subdirectories.  Subdirectories can also have
  1278.              subdirectories, extending in a branching tree structure from
  1279.              the root directory.  The collection of all directories on a
  1280.              drive is often called the directory tree, and a portion of the
  1281.              tree is sometimes called a subtree.  The terms directory and
  1282.              subdirectory are typically used interchangeably to mean a
  1283.              single subdirectory within this tree structure.
  1284.  
  1285.              Subdirectory names follow the same naming rules as files in
  1286.              each operating system (see below).  However, under DOS it is
  1287.              best to use a name of 8 characters or less, without an
  1288.              extension, when naming subdirectories, because some
  1289.              application programs do not properly handle subdirectory names
  1290.              that have an extension.
  1291.  
  1292.  
  1293.  
  1294.         -------------------------------------------------------------------
  1295.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 15
  1296.                                                CHAPTER 1 / GENERAL CONCEPTS
  1297.         -------------------------------------------------------------------
  1298.  
  1299.  
  1300.              The drive and subdirectory portion of a file's name are
  1301.              collectively called the file's path.  For example, the file
  1302.              name C:\DIR1\DIR2\MYFILE.DAT says to look for the file
  1303.              MYFILE.DAT in the subdirectory DIR2 which is part of the
  1304.              subdirectory DIR1 which is on drive C.  The path for
  1305.              MYFILE.DAT is C:\DIR1\DIR2.  The backslashes between
  1306.              subdirectory names are required.  The total length of a file's
  1307.              path may not exceed 64 characters in DOS, and on FAT volumes
  1308.              under OS/2 and Windows NT.  (This limit excludes the file name
  1309.              and extension, but includes the drive letter and colon).  On
  1310.              HPFS and NTFS volumes, the path and file name must each be 255
  1311.              characters or less in length, and in addition the total length
  1312.              of the path and file name together cannot exceed 260
  1313.              characters.
  1314.  
  1315.              The operating system and command processor remember both a
  1316.              current or default drive for your system as a whole, and a
  1317.              current or default directory for every drive in your system.
  1318.              Whenever a program tries to create or access a file without
  1319.              specifying the file's path, the operating system uses the
  1320.              current drive (if no other drive is specified) and the current
  1321.              directory (if no other directory path is specified).
  1322.  
  1323.              The root directory is named using the drive letter and a
  1324.              single backslash.  For example, D:\ refers to the root
  1325.              directory of drive D:.  Using a drive letter with no directory
  1326.              name at all refers to the current directory on the specified
  1327.              drive.  For example, E:4DOS.DOC refers to the file 4DOS.DOC in
  1328.              the current directory on drive E:.
  1329.  
  1330.              There are also two special subdirectory names that are useful
  1331.              in many situations:  a single period [.] by itself means "the
  1332.              current default directory."  Two periods together [..] means
  1333.              "the directory which contains the current default directory"
  1334.              (often referred to as the parent directory).  These special
  1335.              names can be used wherever a full directory name can be used.
  1336.              4DOS, 4OS2, and 4DOS/NT allow you to use additional periods to
  1337.              specify directories further "up" the tree (see page 59).
  1338.  
  1339.  
  1340.              File Names
  1341.  
  1342.              Finally, each file has a filename.  Under the FAT file system,
  1343.              the filename consists of a base name of 1 to 8 characters plus
  1344.              an optional extension composed of a period plus 1 to 3 more
  1345.              characters.  You can use alphabetic and numeric characters
  1346.              plus the punctuation marks ! # $ % & ' ( ) - @ ^ _ ` { } and ~
  1347.              in both the base name and the extension.  Because the
  1348.              exclamation point [!], percent sign [%], caret [^], at sign
  1349.              [@], parentheses [()], and back-quote [`] also have other
  1350.  
  1351.         -------------------------------------------------------------------
  1352.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 16
  1353.                                                CHAPTER 1 / GENERAL CONCEPTS
  1354.         -------------------------------------------------------------------
  1355.  
  1356.  
  1357.              meanings to 4DOS, 4OS2, and 4DOS/NT, it is best to avoid using
  1358.              them in filenames.
  1359.  
  1360.              The HPFS file system, which can be used under OS/2 and Windows
  1361.              NT, allows file names with a maximum of 255 characters,
  1362.              including spaces and other characters that are not allowed in
  1363.              a FAT system file name, but excluding some punctuation
  1364.              characters which are allowed in FAT file names.  See your
  1365.              operating system documentation for details on the characters
  1366.              allowed.  If you use HPFS filenames which contain semicolons
  1367.              [;], see page 62 for details on avoiding problems with
  1368.              interpretation of the semicolon under 4OS2 and 4DOS/NT.
  1369.  
  1370.              The NTFS file system which can be used under Windows NT also
  1371.              allows file names with a maximum of 255 characters.
  1372.  
  1373.              HPFS and NTFS filenames, and all filenames under Windows NT
  1374.              3.5 and above, are stored and displayed exactly as you entered
  1375.              them, and are not automatically shifted to upper or lower case.
  1376.              For example, you could create a file called MYFILE, myfile, or
  1377.              MyFile, and each name would be stored in the directory just as
  1378.              you entered it.  However, case is ignored when looking for
  1379.              filenames, so you cannot have two files whose names differ
  1380.              only in case (i.e., the three names given above would all
  1381.              refer to the same file).  This behavior is sometimes described
  1382.              as "case- retentive but not case-sensitive" because the case
  1383.              information is retained, but does not affect access to the
  1384.              files.
  1385.  
  1386.              Files stored on HPFS and NTFS volumes often have "FAT-
  1387.              compatible" names:  names which contain only those characters
  1388.              legal on a FAT volume, and which meet the 8-character name /
  1389.              3-character extension limits.  Programs which cannot handle
  1390.              the long names supported by HPFS and NTFS (for example, DOS
  1391.              programs running under OS/2) generally can access files with
  1392.              FAT-compatible names.
  1393.  
  1394.     4DOS     4DOS is compatible with FAT volumes.  When running in a DOS
  1395.              session under OS/2, 4DOS can also access files on HPFS volumes
  1396.              and installable file system volumes (see below), provided the
  1397.              files have FAT-compatible names.  Files on such volumes which
  1398.              do not have FAT-compatible names will be invisible to 4DOS.
  1399.  
  1400.              If an HPFS or NTFS-compatible file name includes spaces or
  1401.              other characters that would not be allowed in a FAT name, you
  1402.              must place double quotes around the entire name.  For example,
  1403.              suppose you have a file named LET3 on a FAT volume, and you
  1404.              want to copy it to the LETTERS directory on drive F:, an HPFS
  1405.              partition, and give it the name Letter To Sara.  To do so, use
  1406.              either of these commands in 4OS2 or 4DOS/NT:
  1407.  
  1408.         -------------------------------------------------------------------
  1409.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 17
  1410.                                                CHAPTER 1 / GENERAL CONCEPTS
  1411.         -------------------------------------------------------------------
  1412.  
  1413.  
  1414.                   [c:\wp] copy let3 f:\LETTERS\"Letter To Sara"
  1415.                   [c:\wp] copy let3 "f:\LETTERS\Letter To Sara"
  1416.  
  1417.              HPFS and NTFS do not explicitly define an "extension" for file
  1418.              names which are not FAT-compatible.  However, the convention
  1419.              used by 4OS2 and 4DOS/NT (and by CMD.EXE) is to treat all
  1420.              characters after the last period in the file name as the
  1421.              extension.  For example, the file name "Letter to Sara" has no
  1422.              extension, whereas the name "Letter.to.Sara" has the extension
  1423.              Sara.
  1424.  
  1425.     4NT      Beginning with version 3.5, Windows NT supports the use of
  1426.              long filenames even on FAT drives.  4DOS/NT will take this
  1427.              difference into account automatically under Windows NT 3.5 and
  1428.              above.  For example, COPY will retain long filenames if
  1429.              possible when copying files to a FAT drive, and DIR will use
  1430.              the HPFS / NTFS display format which accommodates long
  1431.              filenames on all drives by default.
  1432.  
  1433.              As a result of this change in Windows NT, for compatibility
  1434.              4DOS/NT assumes that all file and directory names retain their
  1435.              case under Windows NT 3.5 and above, even on FAT drives
  1436.              (normally this assumption is made only for HPFS and NTFS
  1437.              drives; see page 17 above for details).
  1438.  
  1439.  
  1440.              File Attributes
  1441.  
  1442.              Each file also has attributes which define characteristics of
  1443.              the file which may be useful to the operating system, to you,
  1444.              or to an application program.  Attributes can be set with the
  1445.              ATTRIB command (see page 173) and viewed with the ATTRIB and
  1446.              DIR commands.
  1447.  
  1448.              Every time a program modifies a file, the operating system
  1449.              sets the Archive attribute, which signals that the file has
  1450.              been modified since it was last backed up.  This can be used
  1451.              by 4DOS, 4OS2, or 4DOS/NT to determine which files to COPY,
  1452.              and by backup programs to determine which files to back up.
  1453.  
  1454.              When the Read-only attribute is set, the file can't be changed
  1455.              or erased; this can be used to protect important files from
  1456.              damage.  The Hidden and System attributes prevent the file
  1457.              from appearing in normal directory listings.  The DIR command
  1458.              (see page 204) has options which allow you to select filenames
  1459.              to view based on their attributes, to view the attributes
  1460.              themselves, and to view information about normally "invisible"
  1461.              hidden and system files.
  1462.  
  1463.  
  1464.  
  1465.         -------------------------------------------------------------------
  1466.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 18
  1467.                                                CHAPTER 1 / GENERAL CONCEPTS
  1468.         -------------------------------------------------------------------
  1469.  
  1470.  
  1471.              When a file is created, and every time it is modified, the
  1472.              operating system records the system time and date in a time
  1473.              stamp in the file's directory entry.  Several 4DOS, 4OS2, and
  1474.              4DOS/NT commands and variable functions, and many backup and
  1475.              utility programs, use this time stamp to determine the
  1476.              relative ages of files.
  1477.  
  1478.  
  1479.         Internal and External Commands
  1480.  
  1481.              Whenever you type something at the command line and press the
  1482.              Enter key, you have given a command to the command processor,
  1483.              which must figure out how to execute your command.  If you
  1484.              understand the general process that 4DOS, 4OS2, and 4DOS/NT
  1485.              use, you will be able to make the best use of them and their
  1486.              commands.
  1487.  
  1488.              The command processor begins by dividing the line you typed
  1489.              into a command name and a command tail.  The command name is
  1490.              the first word in the command; the tail is everything that
  1491.              follows the command name.  For example, in this command line:
  1492.  
  1493.                   dir *.txt /2/p/v
  1494.  
  1495.              the command name is "dir", and the command tail is " *.txt
  1496.              /2/p/v."
  1497.  
  1498.              If the command name is not an alias (see page 77), the command
  1499.              processor tries to find the name in its list of internal
  1500.              commands.  An internal command is one that the command
  1501.              processor can perform itself, without running another program.
  1502.              DIR and COPY are examples of internal commands.
  1503.  
  1504.              If the command name is not found in the command processor's
  1505.              list of internal commands, it assumes that it must find and
  1506.              execute an external command.  This means that the command
  1507.              processor must load and run a separate program, either an
  1508.              executable program or a batch file.  DOS, OS/2, and Windows NT
  1509.              are shipped with a number of external utility programs (such
  1510.              as FORMAT and DISKCOPY), and any program or application you
  1511.              install on your system becomes a new external command.
  1512.  
  1513.              The advantage of internal commands is that they run almost
  1514.              instantly.  When you give an internal command, the command
  1515.              processor interprets the command line and carries out the
  1516.              necessary activities without having to look for, load, and run
  1517.              another program.
  1518.  
  1519.              The advantage of external commands is that they can be large,
  1520.              varied, and complex without taking space inside the system
  1521.  
  1522.         -------------------------------------------------------------------
  1523.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 19
  1524.                                                CHAPTER 1 / GENERAL CONCEPTS
  1525.         -------------------------------------------------------------------
  1526.  
  1527.  
  1528.              command processor.  External commands can also be renamed or
  1529.              replaced easily.  If you want to rename the external DOS
  1530.              command XCOPY to MYCOPY, for example, all you need to do is
  1531.              find the file called XCOPY.EXE on your DOS disk or directory
  1532.              and change its name to MYCOPY.EXE.  If you want to replace
  1533.              XCOPY with a more efficient program, you can do so.  4DOS,
  1534.              4OS2, and 4DOS/NT add this flexibility to internal commands.
  1535.              You can rename or replace any internal command by using an
  1536.              alias (see pages 77 and 161), and you can enable or disable
  1537.              internal commands whenever you wish (see SETDOS /I on page
  1538.              324).
  1539.  
  1540.  
  1541.         Executable Files and File Searches
  1542.  
  1543.              Once the command processor knows that it is supposed to run an
  1544.              external command, it tries to find an executable file (one
  1545.              with a .COM or .EXE extension) whose name matches the command
  1546.              name.  It runs the executable file if it finds one.  (See the
  1547.              previous section for more information on external commands.)
  1548.  
  1549.              If the command processor cannot find an external program to
  1550.              run, it next looks for a batch file (a file with one or more
  1551.              commands in it) whose name matches the command name.  4DOS
  1552.              recognizes a file as a batch file if its extension is .BAT or
  1553.              .BTM.  4OS2 recognizes .CMD, .BTM, and .BAT as batch file
  1554.              extensions.  It will run .CMD and .BTM files itself, and will
  1555.              start a DOS session to run .BAT files.  4DOS/NT can run batch
  1556.              files with a .BAT, .CMD, or .BTM extension.  If the command
  1557.              processor finds such a file, it then reads each line in the
  1558.              file as a new command.
  1559.  
  1560.              If the search for a batch file fails, the command processor
  1561.              checks to see if the command name matches the name of a file
  1562.              with an extension that you have defined as executable.  If a
  1563.              match is found, the command processor runs the program you
  1564.              specified when you defined the executable extension.
  1565.              (Executable extensions are used to associate file extensions
  1566.              with the specific program that processes a particular type of
  1567.              file; see page 68 for details).
  1568.  
  1569.              4DOS, 4OS2, and 4DOS/NT first search for an executable
  1570.              program, a batch file, and a file with an executable extension
  1571.              in the current directory.  If the command name doesn't match a
  1572.              .COM, .EXE, .BTM, .BAT or .CMD file or an executable extension
  1573.              in the current directory, the command processor repeats its
  1574.              search in every directory in your search path.
  1575.  
  1576.              The search path is a list of directories that the command
  1577.              processor (and some applications) search for executable files.
  1578.  
  1579.         -------------------------------------------------------------------
  1580.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 20
  1581.                                                CHAPTER 1 / GENERAL CONCEPTS
  1582.         -------------------------------------------------------------------
  1583.  
  1584.  
  1585.              For example, if you wanted the command processor to search the
  1586.              root directory of the C: drive, the \DOS subdirectory on the
  1587.              C: drive, and the \UTIL directory on the D: drive for
  1588.              executable files, your search path would look like this:
  1589.  
  1590.                   PATH=C:\;C:\DOS;C:\UTIL
  1591.  
  1592.              Notice that the directory names in the search path are
  1593.              separated by semicolons.
  1594.  
  1595.              You can create or view the search path with the PATH command
  1596.              (see page 290).  You can use the ESET command (see page 227)
  1597.              to edit the path.  Many programs also use the search path to
  1598.              find their own files.  The search path is stored in the
  1599.              environment with the name PATH.
  1600.  
  1601.              Remember, the command processor always looks for an executable
  1602.              file or a file with an executable extension first in the
  1603.              current subdirectory, and then in each directory in the search
  1604.              path.  (You can change the search order so the current
  1605.              directory is not searched first; see the PATH command for
  1606.              details.)
  1607.  
  1608.              If you include an extension as part of the command name, the
  1609.              command processor only searches for a file with that
  1610.              extension.  For example, if you enter the command WP, 4DOS,
  1611.              4OS2, or 4DOS/NT will search for any executable file whose
  1612.              base name is WP.  However, if you enter WP.EXE as the command
  1613.              name, the command processor will search the current directory
  1614.              and each directory in your search path for WP.EXE, but will
  1615.              not look for files with other extensions.
  1616.  
  1617.              If the command processor cannot find an executable file, batch
  1618.              program, or a file with an executable extension in the current
  1619.              directory or any directory in the search path, it looks for an
  1620.              alias called UNKNOWN_CMD (see ALIAS on page 161 for details).
  1621.              If you have defined an alias with that name, it is executed.
  1622.              Otherwise, the command processor displays an "Unknown command"
  1623.              error message and waits for your next instruction.
  1624.  
  1625.  
  1626.         The Environment
  1627.  
  1628.              The command processor allows you to keep a list of information
  1629.              in memory.  This list is called the environment.  Every
  1630.              program receives a copy of the environment when it begins, and
  1631.              many programs use some of its information to configure
  1632.              themselves or to find files.
  1633.  
  1634.  
  1635.  
  1636.         -------------------------------------------------------------------
  1637.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 21
  1638.                                                CHAPTER 1 / GENERAL CONCEPTS
  1639.         -------------------------------------------------------------------
  1640.  
  1641.  
  1642.              The environment is arranged as a series of variables and their
  1643.              related values.  Each variable is a name stored in upper case.
  1644.              The name is followed by an equal sign [=] and some text.  You
  1645.              can view the environment by typing SET, and add new entries or
  1646.              edit existing entries with the SET and ESET commands.  You can
  1647.              erase entries in the environment with both the UNSET and SET
  1648.              commands.
  1649.  
  1650.              A typical environment entry looks like this:
  1651.  
  1652.                   LIB=c:\lib
  1653.  
  1654.              In this example, the name of the variable is "LIB" and its
  1655.              value is "c:\lib".  The text string or value can include any
  1656.              characters except nulls (ASCII 0).
  1657.  
  1658.              The format and meaning of each entry in the environment is up
  1659.              to the program that uses the particular variable.  Environment
  1660.              variables can contain just about anything, and can be used for
  1661.              any purpose the author of a program desires.  The "purpose" of
  1662.              the environment as a whole is simply to hold small amounts of
  1663.              text which programs can then access according to their own
  1664.              rules.  Most environment variables are used by single programs
  1665.              for their own information; a few have well-defined meanings
  1666.              and are used by many different programs.
  1667.  
  1668.              4DOS, 4OS2, and 4DOS/NT use several environment variables to
  1669.              control their own behavior.  They also provide a wide range of
  1670.              facilities for manipulating and managing the environment.  See
  1671.              "Using the Environment" beginning on page 96 for details about
  1672.              these special variables, the size of the environment, and
  1673.              other environment-related features.
  1674.  
  1675.  
  1676.         ASCII and Key Codes
  1677.  
  1678.              Internally, computers use numbers for everything.  To
  1679.              represent the text that you type, a computer must translate
  1680.              each letter to and from a number.  For all PC-compatible
  1681.              computers, the code used for this translation is called ASCII
  1682.              (American Standard Code for Information Interchange).  ASCII
  1683.              codes are used both for the characters you type and for the
  1684.              characters that are displayed on the screen.
  1685.  
  1686.              The original ASCII code has 128 values for upper and lower
  1687.              case letters, numerals, punctuation marks, and control codes
  1688.              (control codes correspond to pressing the Ctrl key plus
  1689.              another character).  Some control codes are represented on the
  1690.              keyboard with such keys as Tab, Enter, Backspace, and Esc.
  1691.              IBM, in its original PC, defined an additional 128 extended
  1692.  
  1693.         -------------------------------------------------------------------
  1694.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 22
  1695.                                                CHAPTER 1 / GENERAL CONCEPTS
  1696.         -------------------------------------------------------------------
  1697.  
  1698.  
  1699.              ASCII codes for math symbols, international characters, the
  1700.              line characters used to draw boxes, and some miscellaneous
  1701.              symbols.  You can enter extended ASCII codes on the keyboard
  1702.              by holding down the Alt key while you type the code number on
  1703.              the numeric key pad.
  1704.  
  1705.              The symbol that the computer displays for each ASCII and
  1706.              extended ASCII code, and the code generated by each key on the
  1707.              keyboard, depends in part on the country and language support
  1708.              that your computer is configured to use.  Through the use of
  1709.              code pages in DOS and OS/2, and the Registry in Windows NT,
  1710.              your computer can be configured for use in most countries.
  1711.              See your operating system documentation for more information
  1712.              about country and language support.
  1713.  
  1714.              Do not confuse extended ASCII with extended key codes.  The
  1715.              latter include special codes that the computer generates when
  1716.              you press a function key, cursor key, or Alt plus a letter
  1717.              (see below).  Those keys do not have any representation in
  1718.              either the ASCII or extended ASCII code systems.  Another set
  1719.              of key codes, called scan codes, is discussed in the section
  1720.              on the keyboard below.
  1721.  
  1722.              Appendix B on page 371 has a complete list of ASCII, extended
  1723.              ASCII, and extended key codes.
  1724.  
  1725.  
  1726.         The Keyboard
  1727.  
  1728.              When you press a single key or a key combination on the
  1729.              keyboard, the computer translates your keystroke into two
  1730.              numbers.  For all alphabetic, numeric, and punctuation keys,
  1731.              the Tab, Enter, Backspace, Esc keys and Ctrl plus an
  1732.              alphabetic key, these numbers are an ASCII code plus a scan
  1733.              code.  The ASCII code represents the key's meaning; the scan
  1734.              code identifies which specific key was pressed.  For example,
  1735.              many keyboards have two plus [+] keys, one above the equal
  1736.              sign and one on the numeric keypad.  Both generate the same
  1737.              ASCII code, but they generate different scan codes.
  1738.  
  1739.              Keys which are not represented by ASCII codes are translated
  1740.              to an ASCII 0 plus an extended key code.  These keys include
  1741.              the function keys, the cursor keys, and Alt plus a key.  The
  1742.              extended key code for a key is generally the same as the scan
  1743.              code for that key.
  1744.  
  1745.              Some keys, like the Alt, Ctrl, and Shift by themselves or in
  1746.              combination with each other, plus Print Screen, SysReq, Scroll
  1747.              Lock, Pause, Break, Num Lock, and Caps Lock, do not have any
  1748.              code representations at all.  The computer performs special
  1749.  
  1750.         -------------------------------------------------------------------
  1751.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 23
  1752.                                                CHAPTER 1 / GENERAL CONCEPTS
  1753.         -------------------------------------------------------------------
  1754.  
  1755.  
  1756.              actions automatically when you press these keys (for example,
  1757.              it switches your keyboard into Caps Lock mode when you press
  1758.              the Caps Lock key), and does not report the keystrokes to
  1759.              whatever program is running unless the program has been
  1760.              written specially to accept them.
  1761.  
  1762.              Appendix B has a complete list of ASCII and scan codes for the
  1763.              keys on most keyboards.
  1764.  
  1765.  
  1766.         Video
  1767.  
  1768.              4DOS, 4OS2, and 4DOS/NT are "character-based" programs, which
  1769.              means they work in text mode on your computer.  In text mode,
  1770.              the screen or window used by the program displays text in a
  1771.              single, fixed-pitch font (a font where every character is the
  1772.              same width), but cannot mix fonts or display graphics.  All
  1773.              three command processors can run graphics programs which
  1774.              change your screen to graphics mode, but the screen must be
  1775.              returned to text mode whenever the command processor is
  1776.              active.  In the early days of the IBM PC, text mode was a
  1777.              single, simple video operating environment.  Today, advanced
  1778.              video boards and video software have created a wide range of
  1779.              text modes.
  1780.  
  1781.              The original IBM PC monochrome and CGA color video cards can
  1782.              display 80 columns and 25 rows of text.  Newer, advanced video
  1783.              systems normally run in this 80 x 25 display mode but can also
  1784.              display more columns and rows.  For example, EGA video cards
  1785.              can display 43 rows of text and VGA video cards can display 50
  1786.              rows.  With special driver programs, a VGA can display 60 rows
  1787.              or more and up to 132 columns of text.  Each of these
  1788.              different screen configurations is a different text mode.
  1789.  
  1790.              In addition to running in a variety of text modes, 4DOS, 4OS2,
  1791.              and 4DOS/NT can run in "normal" full-screen mode or in a
  1792.              window inside a graphical environment such as the Windows or
  1793.              Windows NT desktop, or the OS/2 Workplace Shell.  When they
  1794.              run in such a window, they are still operating in text mode.
  1795.              The underlying graphical environment translates their text
  1796.              commands into the appropriate graphics for your video display.
  1797.  
  1798.              4DOS, 4OS2, and 4DOS/NT support whatever number of rows and
  1799.              columns of text you decide to use.  They don't have commands
  1800.              to switch from one screen size to another - you will need to
  1801.              use the software that came with your computer or video board
  1802.              to do that - but they can read and work with the number of
  1803.              rows and columns on your screen.
  1804.  
  1805.  
  1806.  
  1807.         -------------------------------------------------------------------
  1808.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 24
  1809.                                                CHAPTER 1 / GENERAL CONCEPTS
  1810.         -------------------------------------------------------------------
  1811.  
  1812.  
  1813.         ANSI Drivers
  1814.  
  1815.     4DOS     Every version of DOS includes a program called ANSI.SYS.  This
  1816.              program lets you use text colors other than drab white on
  1817.              black, redefine keys, and control screen output.  Commercial
  1818.              ANSI drivers are available as replacements for ANSI.SYS.  The
  1819.              commercial programs usually include many new features, boost
  1820.              screen display speed dramatically, and support text displays
  1821.              that have more than 80 columns and 25 lines.
  1822.  
  1823.              In most cases, 4DOS automatically determines whether you have
  1824.              an ANSI driver installed (if the automatic determination does
  1825.              not work on your system you can set the ANSI state manually).
  1826.              If you do have an ANSI driver installed, 4DOS will use the
  1827.              driver to clear the screen and set screen colors.
  1828.  
  1829.     4OS2     OS/2 includes ANSI support for character mode sessions.  4OS2
  1830.              enables this feature when it starts, and assumes that it
  1831.              remains enabled.  You can turn off ANSI support with OS/2's
  1832.              external ANSI command (ANSI.EXE).  If you do, however, 4OS2
  1833.              will not notice the change and will display unusual characters
  1834.              or ignore colors in your CLS and COLOR commands.
  1835.  
  1836.     4NT      There is no provision for ANSI support in Windows NT, and
  1837.              4DOS/NT always assumes that no ANSI driver is present.
  1838.  
  1839.              Several 4DOS, 4OS2, and 4DOS/NT commands provide replacements
  1840.              for traditional ANSI commands.  For example, there are
  1841.              commands to set the screen colors and display text in specific
  1842.              colors.  These commands are easier to understand and use than
  1843.              the traditional ANSI control sequences.  Some of these
  1844.              commands manipulate screen colors directly.  Others use an
  1845.              ANSI driver if one is installed (under 4DOS) or expected
  1846.              (under 4OS2), but save you the work of figuring out complex
  1847.              ANSI control sequences.  Any special interaction between 4DOS
  1848.              or 4OS2 and the ANSI driver is described in the documentation
  1849.              for each command.
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.         -------------------------------------------------------------------
  1865.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 25
  1866.                                                     CHAPTER 2 / CONVENTIONS
  1867.         -------------------------------------------------------------------
  1868.  
  1869.  
  1870.  
  1871.         CHAPTER 2 / CONVENTIONS
  1872.  
  1873.  
  1874.         This chapter contains information about three conventions that are
  1875.         used throughout 4DOS, 4OS2, and 4DOS/NT:  colors and color names,
  1876.         color-coded directories, and keys and key names.  These topics are
  1877.         combined here in a central reference spot so that they will be easy
  1878.         to find when you need to refer to them.  You will find cross
  1879.         references to this chapter in several other parts of this manual.
  1880.  
  1881.  
  1882.         Colors and Color Names
  1883.  
  1884.              You can use color names in several of the directives in the
  1885.              .INI file and in many commands.  The general form of a color
  1886.              name is:
  1887.  
  1888.                   [BRIght] [BLInk] fg ON [BRIght] bg [BORder bc]
  1889.  
  1890.              where fg is the foreground or text color, bg is the background
  1891.              color, and bc is the border color.
  1892.  
  1893.              The available colors are:
  1894.  
  1895.                   Black        Blue         Green          Red
  1896.                   Magenta      Cyan         Yellow         White
  1897.  
  1898.              Color names and the words BRIght, BLInk, and BORder may be
  1899.              shortened to the first 3 letters.  BORder is valid only in
  1900.              4DOS and 4OS2.
  1901.  
  1902.              You can also specify colors by number instead of by name.  The
  1903.              numbers are most useful in potentially long INI file
  1904.              directives like ColorDir. The following numbers are
  1905.              recognized:
  1906.  
  1907.                          0 - Black         8 - Gray (bright black)
  1908.                          1 - Blue          9 - Bright blue
  1909.                          2 - Green         10 - Bright green
  1910.                          3 - Cyan          11 - Bright cyan
  1911.                          4 - Red           12 - Bright red
  1912.                          5 - Magenta       13 - Bright magenta
  1913.                          6 - Yellow        14 - Bright yellow
  1914.                          7 - White         15 - Bright white
  1915.  
  1916.              Use one number to substitute for the [BRIght] fg portion of
  1917.              the color name, and a second to substitute for the [BRIght] bg
  1918.              portion.  For example, instead of bright cyan on blue you
  1919.              could use 11 on 1 to save space in a ColorDir specification.
  1920.  
  1921.         -------------------------------------------------------------------
  1922.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 26
  1923.                                                     CHAPTER 2 / CONVENTIONS
  1924.         -------------------------------------------------------------------
  1925.  
  1926.  
  1927.              There are several subtleties that complicate the use of colors
  1928.              and color names.  In order to understand them, you will need
  1929.              to read through the restrictions described below.  You may
  1930.              also want to review the Video section in the previous chapter
  1931.              (see page 24).  These restrictions are due to the design of
  1932.              your PC video hardware, BIOS, and video drivers, and are not
  1933.              inherent in 4DOS, 4OS2, or 4DOS/NT.  Some of the restrictions
  1934.              are complex, so feel free to skip over those that do not apply
  1935.              to color combinations you use.
  1936.  
  1937.              Some restrictions depend on the display "mode."  4DOS, 4OS2,
  1938.              and 4DOS/NT can run in either normal display mode, when the
  1939.              command processor is using the full screen and has more direct
  1940.              control over the video hardware; or in windowed display mode,
  1941.              when the command processor appears in a window as part of a
  1942.              graphical display under Windows 3.x, OS/2, or Windows NT.
  1943.  
  1944.  
  1945.              Monochrome Video Adapters
  1946.  
  1947.              If you have a monochrome video adapter, you cannot display any
  1948.              colors except white and black in either normal or bright
  1949.              intensity.  If you have a color video adapter, you can use any
  1950.              of the standard colors listed above (provided you meet the
  1951.              other restrictions below).
  1952.  
  1953.  
  1954.              Color Errors
  1955.  
  1956.              A standard color specification allows sixteen foreground and
  1957.              eight background colors (sixteen if bright backgrounds are
  1958.              enabled, see below).  However, most video adapters and
  1959.              monitors do not provide true renditions of certain colors.
  1960.              For example, most users see normal "yellow" as brown, and
  1961.              bright yellow as yellow; many also see normal red as red, and
  1962.              "bright red" as pink.  Color errors are often much worse when
  1963.              running in windowed mode (see above), because the graphical
  1964.              environment that created the window may not map the text-mode
  1965.              colors the way you expect.  These problems are inherent in the
  1966.              monitor, video adapter, and driver software.  They cannot be
  1967.              corrected using 4DOS, 4OS2, or 4DOS/NT color specifications.
  1968.  
  1969.  
  1970.              Border Colors
  1971.  
  1972.              In order to use border colors, you must have a color video
  1973.              adapter (monochrome adapters do not support border colors).
  1974.  
  1975.     4NT      4DOS/NT does not support border colors, and will ignore the
  1976.              BORder keyword.
  1977.  
  1978.         -------------------------------------------------------------------
  1979.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 27
  1980.                                                     CHAPTER 2 / CONVENTIONS
  1981.         -------------------------------------------------------------------
  1982.  
  1983.  
  1984.     4DOS,    4DOS and 4OS2 can only accept border colors in the CLS and
  1985.              COLOR
  1986.     4OS2     commands, and in the StdColors directive in the .INI file.
  1987.              Border colors will be ignored, or will cause an error, if they
  1988.              are used elsewhere.
  1989.  
  1990.              Border colors do not work in windowed mode, and will be
  1991.              ignored if used in a windowed session under Windows or OS/2.
  1992.  
  1993.  
  1994.              Blinking Text and Bright Background Colors
  1995.  
  1996.              The interactions between blinking characters, bright
  1997.              backgrounds, and your display mode can be complex.  You will
  1998.              need to understand them if you use either attribute in your
  1999.              color specifications.
  2000.  
  2001.              Bright background colors are only available if you have an
  2002.              EGA- or VGA-compatible display adapter.  If you have a
  2003.              monochrome or CGA adapter, you can use blinking displays and
  2004.              ignore the interactions described below.
  2005.  
  2006.              The effects of blinking and bright background color
  2007.              specifications depend partly on whether you are in normal or
  2008.              windowed display mode.
  2009.  
  2010.  
  2011.              Normal Display Mode
  2012.  
  2013.              In normal, full-screen display mode your video hardware can be
  2014.              configured via software commands to display either blinking
  2015.              text, or text with a bright background, but not both.  This is
  2016.              due to the design of PC video hardware, and is not a software
  2017.              restriction.
  2018.  
  2019.              The memory on your video adapter includes a "flag" for each
  2020.              character on the screen.  The flag controls blinking text and
  2021.              bright background colors.  If the flag is off, the character
  2022.              is displayed with a normal background and does not blink.  If
  2023.              the flag is "on," the character either blinks or is displayed
  2024.              with a bright background, depending on which way your video
  2025.              adapter is currently configured.
  2026.  
  2027.     4DOS,    In normal display mode, the configuration of your video
  2028.     4OS2     adapter can be controlled by 4DOS and 4OS2 with the BrightBG
  2029.              directive in the 4DOS.INI file (see page 141) or the SETDOS /B
  2030.              command (page 323).  If you set BrightBG = No or use the
  2031.              SETDOS /B0 command, 4DOS and 4OS2 will configure the video
  2032.              adapter for blinking text, and characters with the blink /
  2033.              bright background flag set will blink.  If you set BrightBG =
  2034.  
  2035.         -------------------------------------------------------------------
  2036.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 28
  2037.                                                     CHAPTER 2 / CONVENTIONS
  2038.         -------------------------------------------------------------------
  2039.  
  2040.  
  2041.              Yes or use SETDOS /B1, 4DOS and 4OS2 will configure the video
  2042.              adapter for bright background colors, and the characters will
  2043.              be displayed with a bright background instead.
  2044.  
  2045.     4NT      BrightBG and SETDOS /B are not available under 4DOS/NT,
  2046.              because Windows NT always enables bright backgrounds and
  2047.              disables blinking text.
  2048.  
  2049.              Because there is only one flag for each character to specify
  2050.              both blinking text and bright background color, it doesn't
  2051.              matter which attribute you use when you specify the color.
  2052.              Whether you specify blinking text or a bright background, you
  2053.              will see the same thing on your screen.  For example, these
  2054.              two COLOR commands will always produce the same results:
  2055.  
  2056.                   color blink white on blue
  2057.                   color white on bright blue
  2058.  
  2059.              If bright backgrounds are enabled, both commands will produce
  2060.              white text on a bright blue background.  If blinking text is
  2061.              enabled, both commands will produce blinking white text on a
  2062.              blue background.
  2063.  
  2064.              If you don't use BrightBG or SETDOS /B, 4DOS and 4OS2 will not
  2065.              attempt to configure your video hardware.  Most video adapters
  2066.              default to blinking text in normal mode, but this can be
  2067.              changed by application programs.  If you use BrightBG or
  2068.              SETDOS /B, 4DOS and 4OS2 will configure the hardware each time
  2069.              they display the prompt.
  2070.  
  2071.              The method used to adjust the video hardware may not be
  2072.              compatible with all video cards.  If you see screen "flashes"
  2073.              at each prompt when you use BrightBG or SETDOS /B, discontinue
  2074.              using both commands.  This problem is very rare and is not
  2075.              likely to occur on standard EGA and VGA systems.
  2076.  
  2077.  
  2078.              Windowed Mode
  2079.  
  2080.              In windowed mode, the command processor cannot control your
  2081.              hardware to select blinking or bright backgrounds.  Instead,
  2082.              Windows, OS/2, and Windows NT all display bright background
  2083.              colors, regardless of the BrightBG or SETDOS /B setting.  They
  2084.              do not provide a way to display blinking characters in
  2085.              windowed mode.  As an example, the two commands given above
  2086.              would both display white text on a bright blue background when
  2087.              run in windowed mode.
  2088.  
  2089.  
  2090.  
  2091.  
  2092.         -------------------------------------------------------------------
  2093.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 29
  2094.                                                     CHAPTER 2 / CONVENTIONS
  2095.         -------------------------------------------------------------------
  2096.  
  2097.  
  2098.              Switching Modes
  2099.  
  2100.              Windows and OS/2 allow you to switch any DOS session between
  2101.              full-screen and windowed mode; Windows NT allows you to switch
  2102.              modes for any console (non-graphical) session.  For example,
  2103.              when running 4DOS in a DOS session under Windows, you can
  2104.              switch modes by pressing Alt-Enter.  Switching modes will
  2105.              usually alter color rendition, as you switch between direct
  2106.              interaction with the video board (in full-screen mode) and the
  2107.              color mapping provided by your graphical environment (in
  2108.              windowed mode).  In addition, switching modes may alter the
  2109.              display of blinking text and bright background characters.
  2110.  
  2111.     4DOS     Under 4DOS, if BrightBG is set to Yes, bright background
  2112.              colors will be preserved when you switch modes.  However, if
  2113.              BrightBG is set to No, the display will shift from blinking
  2114.              text in the full-screen mode to bright background colors
  2115.              behind that text in the windowed mode.  This effect can be
  2116.              disturbing; you may need to take it into account if you write
  2117.              batch files or aliases which may be used in either mode.
  2118.  
  2119.     4OS2     You cannot switch modes for OS/2 sessions, so 4OS2 is not
  2120.              directly affected by mode switching.  However, if you write
  2121.              batch files or aliases which run in both modes, you may need
  2122.              to take into account that OS/2 defaults to displaying blinking
  2123.              text in full-screen mode and bright backgrounds in windowed
  2124.              mode.
  2125.  
  2126.  
  2127.         Color-Coded Directories
  2128.  
  2129.              The DIR and SELECT commands can display each file name in a
  2130.              different color, depending on the file's extension.
  2131.  
  2132.              To choose the DIR and SELECT display colors, you must either
  2133.              use the SET command to create an environment variable called
  2134.              COLORDIR, or use the ColorDir directive in your .INI file.
  2135.  
  2136.              If you do not use the COLORDIR variable or the ColorDir
  2137.              directive, DIR will use the default screen colors and SELECT
  2138.              will use the default screen colors or those set with the
  2139.              SelectColors directive.
  2140.  
  2141.              If you use both the COLORDIR variable and the ColorDir
  2142.              directive, the environment variable will override the settings
  2143.              in your .INI file.  You may find it useful to use the COLORDIR
  2144.              variable for experimenting, then to set permanent directory
  2145.              colors with the ColorDir directive.
  2146.  
  2147.  
  2148.  
  2149.         -------------------------------------------------------------------
  2150.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 30
  2151.                                                     CHAPTER 2 / CONVENTIONS
  2152.         -------------------------------------------------------------------
  2153.  
  2154.  
  2155.              The format for both the COLORDIR environment variable and the
  2156.              ColorDir directive in the .INI file is:
  2157.  
  2158.                   ext ... :ColorName; ...
  2159.  
  2160.              where "ext" is a file extension (which may include wildcards)
  2161.              or one of the following file types:
  2162.  
  2163.                   DIRS      Directories
  2164.                   RDONLY    Read-only files
  2165.                   HIDDEN    Hidden files
  2166.                   SYSTEM    System files
  2167.                   ARCHIVE   Files modified since the last backup
  2168.  
  2169.              and "ColorName" is any valid color name (see page 26 for
  2170.              information on color names).
  2171.  
  2172.              Unlike most color specifications, the background portion of
  2173.              the color name may be left out for directory colors.  If you
  2174.              don't specify a background color, DIR and SELECT will use the
  2175.              current screen background color.
  2176.  
  2177.              For example, to display the .COM and .EXE files in red on the
  2178.              current background, the .C and .ASM files in bright cyan on
  2179.              the current background, and the read-only files in blinking
  2180.              green on white (this should be entered on one line):
  2181.  
  2182.                   c:\> set colordir=com exe:red; c asm:bright cyan;
  2183.                        rdonly:blink green on white
  2184.  
  2185.              Extended wildcards (for example "BA[KXC]" for .BAK, .BAX, and
  2186.              .BAC files) can be used in directory color specifications.
  2187.              See page 59 for more information on extended wildcards.
  2188.  
  2189.     4DOS  ## 4DOS normally writes text directly to the screen when
  2190.              displaying color-coded directories.  If you have an unusual
  2191.              display adapter which does not support direct video output,
  2192.              see the OutputBIOS directive on page 150.
  2193.  
  2194.  
  2195.         Keys and Key Names
  2196.  
  2197.              Key names are used to define keystroke aliases, in several of
  2198.              the .INI file directives, and with the 4DOS KEYSTACK command.
  2199.              The format of a key name is the same in all three uses:
  2200.  
  2201.                   [Prefix-]Keyname
  2202.  
  2203.              The key prefix can be left out, or it can be any one of the
  2204.              following:
  2205.  
  2206.         -------------------------------------------------------------------
  2207.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 31
  2208.                                                     CHAPTER 2 / CONVENTIONS
  2209.         -------------------------------------------------------------------
  2210.  
  2211.  
  2212.                   Alt    followed by A - Z, 0 - 9, F1 - F12, or Bksp
  2213.                   Ctrl   followed by A - Z, F1 - F12, Tab, Bksp, Enter,
  2214.                          Left, Right, Home, End, PgUp, PgDn, Ins, or Del
  2215.                   Shift  followed by F1 - F12 or Tab.
  2216.  
  2217.              The possible key names are:
  2218.  
  2219.                   A - Z        Enter        PgDn
  2220.                   0 - 9        Up           Home
  2221.                   F1 - F12     Down         End
  2222.                   Esc          Left         Ins
  2223.                   Bksp         Right        Del
  2224.                   Tab          PgUp
  2225.  
  2226.              All key names must be spelled as shown.  Alphabetic keys can
  2227.              be specified in upper-case or lower-case.  You cannot specify
  2228.              a punctuation key.
  2229.  
  2230.              The prefix and key name must be separated by a dash [-].  For
  2231.              example:
  2232.  
  2233.                   Alt-F10        This is okay
  2234.                   Alt F10        The space will cause an error
  2235.  
  2236.              If you prefer, you can use a numeric value instead of a key
  2237.              name.  Use the ASCII code for an ASCII, extended ASCII, or
  2238.              control character.  Use the scan code preceded by an at sign
  2239.              [@] for extended key codes like F1 or the cursor keys.  For
  2240.              example, use 13 for Enter, or @59 for F1.  In general, you
  2241.              will find it easier to use the names described above rather
  2242.              than key numbers.  See Appendix B (page 371) for an
  2243.              explanation and list of ASCII and key codes.
  2244.  
  2245.              Some keys are intercepted by your operating system or BIOS and
  2246.              are not passed on to 4DOS, 4OS2, or 4DOS/NT.  For example,
  2247.              under DOS Ctrl-S pauses screen output temporarily, and on some
  2248.              systems Ctrl-P toggles Print Echo mode (where text displayed
  2249.              on the screen is automatically echoed to the printer).  Keys
  2250.              which are intercepted by the operating system or BIOS
  2251.              generally cannot be assigned to aliases or with key mapping
  2252.              directives, because the command processor never receives these
  2253.              keystrokes and therefore cannot act on them.
  2254.  
  2255.              You also may not be able to use certain keys if your keyboard
  2256.              is not 100% IBM-compatible, your keyboard driver does not
  2257.              support them, or, under DOS, if you have an ANSI driver which
  2258.              does not support them.  For example, on some systems the F11
  2259.              and F12 keys are not recognized; others may not support
  2260.              unusual combinations like Ctrl-Tab.  These problems are rare;
  2261.              when they do occur, they are usually due to the operating
  2262.  
  2263.         -------------------------------------------------------------------
  2264.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 32
  2265.                                                     CHAPTER 2 / CONVENTIONS
  2266.         -------------------------------------------------------------------
  2267.  
  2268.  
  2269.              system and/or your ANSI driver, and not to any problem with
  2270.              4DOS, 4OS2, or 4DOS/NT.
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.  
  2319.  
  2320.         -------------------------------------------------------------------
  2321.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 33
  2322.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  2323.         -------------------------------------------------------------------
  2324.  
  2325.  
  2326.  
  2327.         CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  2328.  
  2329.  
  2330.         4DOS, 4OS2, and 4DOS/NT are both a collection of commands and a set
  2331.         of features which make your computer easier to use.  The commands
  2332.         are explained in the Command Reference section which begins on page
  2333.         153.  This chapter explains each of the features that are not
  2334.         directly related to individual commands.
  2335.  
  2336.         Most of the features described in this section are easy to use, but
  2337.         a few are more technical in nature.  Such features are marked with
  2338.         a ## next to the feature name or the paragraph which describes the
  2339.         feature's operation.
  2340.  
  2341.         As you read through this section, we urge you to experiment with
  2342.         the features that catch your interest and pass over any which seem
  2343.         too complicated.  Come back to this section as you gain expertise,
  2344.         and you will probably discover that the more complex features will
  2345.         seem easy and very useful.  You don't need to learn any more than
  2346.         you want, and even if you are a computer novice, you'll find some
  2347.         features that will interest you immediately.
  2348.  
  2349.         If you come across terms or concepts in this chapter that you are
  2350.         unsure about, refer to Chapter 1 / General Concepts, the Glossary
  2351.         on page    , or the Index.                381
  2352.  
  2353.  
  2354.         At the Command Line
  2355.  
  2356.              4DOS displays a c:\> prompt when it is waiting for you to
  2357.              enter a command.  4OS2 and 4DOS/NT display the similar [c:\]
  2358.              prompt.  (In each case, the actual text depends on the current
  2359.              drive and directory as well as your PROMPT settings.)  This is
  2360.              called the command line and the prompt is asking you to enter
  2361.              a command, an alias or batch file name, or the instructions
  2362.              necessary to begin an application program.
  2363.  
  2364.              This section of the manual explains the features that will
  2365.              help you while you are typing in commands, and how keystrokes
  2366.              are interpreted when you enter them at the command line.  The
  2367.              keystrokes discussed here are the ones normally used by 4DOS,
  2368.              4OS2, and 4DOS/NT.  If you prefer using different keystrokes
  2369.              to perform these functions, you can assign new ones with
  2370.              keystroke directives in the .INI file (see page 126).
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.         -------------------------------------------------------------------
  2378.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 34
  2379.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  2380.         -------------------------------------------------------------------
  2381.  
  2382.  
  2383.              Command-Line Editing
  2384.  
  2385.              The command line works like a single-line word processor,
  2386.              allowing you to edit any part of the command at any time
  2387.              before you press Enter to execute it, or Esc to erase it.
  2388.  
  2389.              The command line extends to a maximum of 255 characters under
  2390.              4DOS and 1023 characters under 4OS2 and 4DOS/NT.
  2391.  
  2392.              You can use the following editing keys when you are typing a
  2393.              command (the words Ctrl and Shift mean to press the Ctrl or
  2394.              Shift key together with the other key named):
  2395.  
  2396.              Cursor Movement:
  2397.  
  2398.                   Left arrow          Move the cursor left one character.
  2399.                   Right arrow         Move the cursor right one character.
  2400.                   Ctrl-Left arrow     Move the cursor left one word.
  2401.                   Ctrl-Right arrow    Move the cursor right one word.
  2402.                   Home                Move the cursor to the beginning of
  2403.                                       the line.
  2404.                   End                 Move the cursor to the end of the
  2405.                                       line.
  2406.  
  2407.              Insert and Delete:
  2408.  
  2409.                   Ins                 Toggle between insert and overtype
  2410.                                       mode.
  2411.                   Del                 Delete the character at the cursor.
  2412.                   Backspace           Delete the character to the left of
  2413.                                       the cursor.
  2414.                   Ctrl-L              Delete the word or partial word to
  2415.                                       the left of the cursor.
  2416.                   Ctrl-R or Ctrl-Bksp Delete the word or partial word to
  2417.                                       the right of the cursor.
  2418.                   Ctrl-Home           Delete from the beginning of the line
  2419.                                       to the cursor.
  2420.                   Ctrl-End            Delete from the cursor to the end of
  2421.                                       the line.
  2422.                   Esc                 Delete the entire line.
  2423.                   Ctrl-C              Cancel the command.
  2424.                     or Ctrl-Break
  2425.                   Enter               Execute the command line.
  2426.  
  2427.     4OS2, ## 4OS2 and 4DOS/NT will prompt for additional command-line
  2428.     4NT      text when you include the escape character as the very last
  2429.              character of a typed command line.  The default escape
  2430.              character in both programs is the caret [^].  For example,
  2431.  
  2432.                   [c:\] echo The quick brown fox jumped over the lazy^
  2433.  
  2434.         -------------------------------------------------------------------
  2435.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 35
  2436.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  2437.         -------------------------------------------------------------------
  2438.  
  2439.  
  2440.                   More? sleeping dog. > alphabet
  2441.  
  2442.          ##  Sometimes you may want to enter one of the above keystrokes on
  2443.              the command line instead of performing the key's usual action.
  2444.              For example, suppose you have a program that requires a Ctrl-R
  2445.              character on its command line.  Normally you couldn't type
  2446.              this keystroke at the prompt, because it would be interpreted
  2447.              as a "Delete word right" command.
  2448.  
  2449.              To get around this problem, use the special keystroke Alt-255.
  2450.              You enter Alt-255 by holding down the Alt key while you type
  2451.              255 on the numeric keypad, then releasing the Alt key (you
  2452.              must use the number keys on the numeric pad; the row of keys
  2453.              at the top of your keyboard won't work).  This forces the
  2454.              command processor to interpret the next keystroke literally
  2455.              and places it on the command line, ignoring any special
  2456.              meaning it would normally have as a command-line editing or
  2457.              history keystroke.  You can use Alt-255 to suppress the normal
  2458.              meaning of command-line editing keystrokes even if they have
  2459.              been reassigned with key mapping directives in the .INI file
  2460.              (see page 126), and Alt-255 itself can be reassigned with the
  2461.              CommandEscape directive.
  2462.  
  2463.              If you want your input at the command line to be in a
  2464.              different color from the command processor's prompts or
  2465.              output, you can use the InputColors directive in your .INI
  2466.              file.  You must have an ANSI driver installed to use
  2467.              InputColors under 4DOS.  See page 142 for more details on
  2468.              InputColors.
  2469.  
  2470.              Most of the command-line editing capabilities are also
  2471.              available when a 4DOS, 4OS2, or 4DOS/NT command prompts you
  2472.              for a line of input.  For example, you can use the command-
  2473.              line editing keys when DESCRIBE (page 201) prompts for a file
  2474.              description, when INPUT (page 262) prompts for input from an
  2475.              alias or batch file, or when LIST (page 272) prompts you for a
  2476.              search string.
  2477.  
  2478.  
  2479.              Command History and Recall
  2480.  
  2481.              Each time you execute a command, the entire command line is
  2482.              saved in a command history list.  You can display the saved
  2483.              commands, search the list, modify commands, and rerun
  2484.              commands.
  2485.  
  2486.              The simplest use of the command history list is to repeat a
  2487.              command exactly.  For example, you might enter the command
  2488.  
  2489.                   c:\> dir b:*.wks;*.doc
  2490.  
  2491.         -------------------------------------------------------------------
  2492.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 36
  2493.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  2494.         -------------------------------------------------------------------
  2495.  
  2496.  
  2497.              to see some of the files on drive B.  You might move some new
  2498.              files to drive B and then want to repeat the DIR command.
  2499.              Just press the Up Arrow key repeatedly to scan back through
  2500.              the history list.  When the DIR command appears, press Enter
  2501.              to execute it again.
  2502.  
  2503.              After you have found a command, you can edit it before
  2504.              pressing Enter.  You will appreciate this feature when you
  2505.              have to execute a series of commands that differ only slightly
  2506.              from each other.
  2507.  
  2508.              The history list is "circular".  If you move to the last
  2509.              command in the list and then press the down arrow one more
  2510.              time, you'll see the first command in the list.  Similarly, if
  2511.              you move to the first command in the list and then press the
  2512.              up arrow one more time, you'll see the last command in the
  2513.              list.
  2514.  
  2515.              You can search the command history list to find a previous
  2516.              command quickly using command completion.  Just enter the
  2517.              first few characters of the command you want to find and press
  2518.              Up Arrow.  You only need to enter enough characters to
  2519.              identify the command that you want to find.  For example, to
  2520.              find the DIR command, enter DI and then press Up Arrow.  If
  2521.              you press the Up Arrow key a second time, you will see the
  2522.              previous command that matches.  The system will beep if there
  2523.              are no matching commands.  The search process stops as soon as
  2524.              you type one of the editing keys, whether or not the line is
  2525.              changed.  At that point, the line you're viewing becomes the
  2526.              new line to match if you press Up Arrow again.
  2527.  
  2528.              You can specify the size of the command history list with the
  2529.              History directive in the .INI file (see page 133).  When the
  2530.              list is full, the oldest commands are discarded to make room
  2531.              for new ones.  You can also use the HistMin directive in the
  2532.              .INI file to enable or disable history saves and to specify
  2533.              the shortest command line that will be saved (see page 139).
  2534.  
  2535.              You can prevent any command line from being saved in the
  2536.              history by beginning it with an at sign [@].
  2537.  
  2538.              When you execute a command from the history, that command
  2539.              remains in the history list in its original position.  The
  2540.              command is not copied to the end of the list (unless you
  2541.              modify it).  If you want each command to be copied to the end
  2542.              of the list when it is re-executed, set HistCopy to Yes in
  2543.              your .INI file (see page 139).
  2544.  
  2545.  
  2546.  
  2547.  
  2548.         -------------------------------------------------------------------
  2549.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 37
  2550.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  2551.         -------------------------------------------------------------------
  2552.  
  2553.  
  2554.              Command History Keys:
  2555.  
  2556.                   Up Arrow            Recall the previous (or most recent)
  2557.                                       command, or the most recent command
  2558.                                       that matches a partial command line.
  2559.                   Down Arrow          Recall the next (or oldest) command,
  2560.                                       or the oldest command that matches a
  2561.                                       partial command line.
  2562.                   F3                  Fill in the rest of the command line
  2563.                                       from the previous command, beginning
  2564.                                       at the current cursor position.
  2565.                   Ctrl-D              Delete the currently displayed
  2566.                                       history list entry, erase the command
  2567.                                       line, and display the previous
  2568.                                       matching history list entry.
  2569.                   Ctrl-E              Display the last entry in the history
  2570.                                       list.
  2571.                   Ctrl-K              Save the current command line in the
  2572.                                       history list without executing it,
  2573.                                       and then clear the command line.
  2574.                   Ctrl-Enter          Copy the current command line to the
  2575.                                       end of the history list even it has
  2576.                                       not been altered.
  2577.                   @                   As the first character in a line:  Do
  2578.                                       not save the current line in the
  2579.                                       history list when it is executed, or
  2580.                                       store it in the CMDLINE environment
  2581.                                       variable (see CMDLINE on page 99 for
  2582.                                       further details).
  2583.  
  2584.              Use F3 when your new command is different from your old one by
  2585.              just a character or two at the beginning.  For example,
  2586.              suppose you want to execute a DIR on several file names then
  2587.              use DEL to delete those same files.  After the DIR is complete
  2588.              type DEL and press F3; the rest of the command line will be
  2589.              completed for you.  Check that it's correct, and then press
  2590.              Enter to delete the files.  F3 also retrieves the entire
  2591.              previous command (like up-arrow) if nothing has been typed on
  2592.              the line.
  2593.  
  2594.              Use Ctrl-E to "get your bearings" by returning to the end of
  2595.              the list if you've scrolled around so much that you aren't
  2596.              sure where you are any more.
  2597.  
  2598.              Use Ctrl-K to save some work when you've typed a long command
  2599.              and then realize that you weren't quite ready.  For example,
  2600.              if you forget to change directories and notice it after a
  2601.              command is typed or mostly typed, but before you press Enter,
  2602.              just press Ctrl-K to save the command without executing it.
  2603.              Use the CD or CDD command to change to the right directory,
  2604.  
  2605.         -------------------------------------------------------------------
  2606.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 38
  2607.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  2608.         -------------------------------------------------------------------
  2609.  
  2610.  
  2611.              press up-arrow twice to retrieve the command you saved, make
  2612.              any final changes to it, and press Enter to execute it.
  2613.  
  2614.              Use Ctrl-Enter to organize the history list for repetitive
  2615.              tasks.  Instead of searching through the command history for
  2616.              the next command in a sequence, you can place all of the
  2617.              necessary commands next to each other and make them easier to
  2618.              repeat.
  2619.  
  2620.  
  2621.              Local and Global Command History
  2622.  
  2623.              The command history can be stored in either a "local" or
  2624.              "global" list.
  2625.  
  2626.              With a local history list, any changes made to the history
  2627.              will only affect the current copy of the command processor.
  2628.              They will not be visible in other shells, or other sessions.
  2629.              A local history list is the default under 4DOS.
  2630.  
  2631.              With a global history list, all copies of the command
  2632.              processor will share the same command history, and any changes
  2633.              made to the history in one copy will affect all other copies.
  2634.              Global lists are the default for 4OS2 and 4DOS/NT.
  2635.  
  2636.              You can control the type of history list with the LocalHistory
  2637.              directive in the .INI file (see page 134), and with the /L and
  2638.              /LH options of the START command (see page 331).
  2639.  
  2640.              There is no fixed rule for deciding whether to use a local or
  2641.              global history list.  Depending on your work style, you may
  2642.              find it most convenient to use one type, or a mixture of types
  2643.              in different sessions or shells.  We recommend that you start
  2644.              with the default approach for your command processor, then
  2645.              modify it if you find a situation where the default is not
  2646.              convenient.
  2647.  
  2648.     4DOS     If you select a global history list for 4DOS running under
  2649.              DOS, you can share the history among all copies of 4DOS.
  2650.              However, if you run 4DOS under OS/2, global lists will apply
  2651.              within each DOS session, but will not allow you to share the
  2652.              history between different DOS sessions.
  2653.  
  2654.     4OS2, ## If you select a global history list for 4OS2 or 4DOS/NT, you
  2655.     4NT      can share the history among all copies of the command
  2656.              processor running in any session.  When you close all 4OS2 or
  2657.              4DOS/NT sessions, the memory for the global history list is
  2658.              released, and a new, empty history list is created the next
  2659.              time you start 4OS2 or 4DOS/NT.  If you want the history list
  2660.              to be retained in memory even when no command processor
  2661.  
  2662.         -------------------------------------------------------------------
  2663.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 39
  2664.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  2665.         -------------------------------------------------------------------
  2666.  
  2667.  
  2668.              session is running, you need to load the SHRALIAS program,
  2669.              which performs this service for the global history and alias
  2670.              lists.  SHRALIAS is described in more detail under the ALIAS
  2671.              command (see page 170).
  2672.  
  2673.              Whenever you start a secondary shell (see page 12) which uses
  2674.              a local history list, it inherits a copy of the command
  2675.              history from the previous shell.  However, any changes to the
  2676.              history made in the secondary shell will affect only that
  2677.              shell.  If you want changes made in a secondary shell to
  2678.              affect the previous shell, use a global history list in both
  2679.              shells.
  2680.  
  2681.  
  2682.              Command History Window
  2683.  
  2684.              You can also view the command history in a scrollable command
  2685.              history window, and select the command to modify or re-execute
  2686.              from those displayed in the window.  To activate the command
  2687.              history window press PgUp or PgDn at the command line.  A
  2688.              window will appear in the upper right corner of the screen,
  2689.              with the command you most recently executed marked with a
  2690.              highlight.  (If you just finished re-executing a command from
  2691.              the history, then the next command in sequence will be
  2692.              highlighted.)
  2693.  
  2694.              You can scroll the command history window up and down one line
  2695.              at a time with Up Arrow and Down Arrow, and one page (screen)
  2696.              at a time with PgUp and PgDn.  The display is not circular as
  2697.              it is at the prompt; it has a fixed beginning and end.  Left
  2698.              Arrow and Right Arrow will pan the text in the history to the
  2699.              left or right.  Home or Ctrl-PgUp will go to the beginning of
  2700.              the history, and End or Ctrl-PgDn will go to the end.  The
  2701.              Ctrl-D (delete from history) key works within the history
  2702.              window as it does at the command line.
  2703.  
  2704.              Once you have selected a command in the history window, press
  2705.              Enter to execute it immediately, or Ctrl-Enter to move the
  2706.              line to the prompt for editing (you cannot edit the line
  2707.              directly in the history window).
  2708.  
  2709.              You can bring up a "filtered" history window by typing some
  2710.              characters on the command line, then pressing PgUp or PgDn.
  2711.              Only those commands matching the typed characters will be
  2712.              displayed in the window.
  2713.  
  2714.              You can control the position and size of the history window
  2715.              with directives in the .INI file (see page 139).  You can also
  2716.              change the keys used in the window with key mapping directives
  2717.              in the .INI file (see page 146).
  2718.  
  2719.         -------------------------------------------------------------------
  2720.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 40
  2721.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  2722.         -------------------------------------------------------------------
  2723.  
  2724.  
  2725.              Command History Window:
  2726.  
  2727.                   PgUp or PgDn        (from the command line) Open the
  2728.                                       command history window.
  2729.                   Up Arrow            Scroll the display up one line.
  2730.                   Down Arrow          Scroll the display down one line.
  2731.                   Left Arrow          Scroll the display left 4 columns.
  2732.                   Right Arrow         Scroll the display right 4 columns.
  2733.                   PgUp                (inside the window) Scroll the
  2734.                                       display up one page.
  2735.                   PgDn                (inside the window) Scroll the
  2736.                                       display down one page.
  2737.                   Ctrl-PgUp or Home   Go to the beginning of the history
  2738.                                       list.
  2739.                   Ctrl-PgDn or End    Go to the end of the history list.
  2740.                   Ctrl-D              Delete the selected line from the
  2741.                                       history list.
  2742.                   Enter               Execute the selected line.
  2743.                   Ctrl-Enter          Move the selected line to the command
  2744.                                       line for editing.
  2745.  
  2746.  
  2747.              Filename Completion
  2748.  
  2749.              Filename completion can help you by filling in a complete file
  2750.              name on the command line when you only remember part of the
  2751.              name.  For example, suppose you want to copy a file.  You know
  2752.              that its name begins AU but you can't remember the rest of the
  2753.              name.  Type:
  2754.  
  2755.                   c:\> copy au
  2756.  
  2757.              and then press the Tab key or F9 key.  4DOS, 4OS2, or 4DOS/NT
  2758.              will search the current directory for filenames that begin AU
  2759.              and insert the first one onto the command line in place of the
  2760.              AU that you typed.
  2761.  
  2762.              If this is the file that you want, simply complete the
  2763.              command.  If the command processor didn't find the file that
  2764.              you were looking for, press Tab or F9 again to substitute the
  2765.              next filename that begins with AU.  When there are no more
  2766.              filenames that match your pattern, the system will beep each
  2767.              time you press Tab or F9.
  2768.  
  2769.              If you go past the filename that you want, press Shift-Tab or
  2770.              F8 to back up and return to the previous matching filename.
  2771.              After you back up to the first filename, the system will beep
  2772.              each time you press Shift-Tab or F8.
  2773.  
  2774.  
  2775.  
  2776.         -------------------------------------------------------------------
  2777.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 41
  2778.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  2779.         -------------------------------------------------------------------
  2780.  
  2781.  
  2782.              If you want to enter more than one matching filename on the
  2783.              same command line, press F10 when each desired name appears.
  2784.              This will keep that name and place the next matching filename
  2785.              after it on the command line.  You can then use Tab (or F9)
  2786.              and Shift-Tab (or F8) to move through the remaining matching
  2787.              files.
  2788.  
  2789.              The pattern you use for matching may contain any valid
  2790.              filename characters, as well as wildcard characters and
  2791.              extended wildcards (see page 59).  For example, you can copy
  2792.              the first matching .TXT file by typing
  2793.  
  2794.                   c:\> copy *.txt
  2795.  
  2796.              and then pressing Tab.
  2797.  
  2798.              If you don't specify part of a filename before pressing Tab,
  2799.              the matching pattern will be *.*.  If you type a filename
  2800.              without an extension, the command processor will add *.* to
  2801.              the name.  It will also place a "*" after a partial extension.
  2802.              If you are typing a group of file names in an include list
  2803.              (see page 67), the part of the include list at the cursor will
  2804.              be used as the pattern to match.
  2805.  
  2806.              When filename completion is used at the start of the command
  2807.              line, it will only match directories, executable files (see
  2808.              page 20), and files with executable extensions, since these
  2809.              are the only file names that it makes sense to use at the
  2810.              start of a command.  If a directory is found, a "\" will be
  2811.              appended to it to enable an automatic directory change (see
  2812.              page 47).
  2813.  
  2814.              Filename Completion Keys:
  2815.  
  2816.                   F8 or Shift-Tab     Get the previous matching filename.
  2817.                   F9 or Tab           Get the next matching filename.
  2818.                   F10                 Keep the current matching filename
  2819.                                       and display the next matching name
  2820.                                       immediately after the current one.
  2821.  
  2822.  
  2823.              Filename Completion Window
  2824.  
  2825.              You can also view filenames in a scrollable filename
  2826.              completion window and select the file you want to work with.
  2827.              To activate the window, press F7 or Ctrl-Tab at the command
  2828.              line.  You will see a window in the upper-right corner of the
  2829.              screen, with the names of files that match any partial
  2830.              filename you have entered on the command line.  If you haven't
  2831.              yet entered a file name, the window will contain the name of
  2832.  
  2833.         -------------------------------------------------------------------
  2834.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 42
  2835.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  2836.         -------------------------------------------------------------------
  2837.  
  2838.  
  2839.              all files in the current directory.  (Ctrl-Tab will work only
  2840.              if your keyboard and BIOS or keyboard driver support it.  If
  2841.              it does not work on your system, use F7 instead.)
  2842.  
  2843.              You can scroll the filename completion window up and down one
  2844.              line at a time with Up Arrow and Down Arrow, and one page
  2845.              (screen) at a time with PgUp and PgDn.  Home or Ctrl-PgUp will
  2846.              go to the beginning of the list of file names; End or Ctrl-
  2847.              PgDn will go to the end.  You can scroll the window left and
  2848.              right 4 spaces at a time with the Left Arrow or Right Arrow.
  2849.  
  2850.              Once you have selected the filename you want, press Enter to
  2851.              insert it into the command line.
  2852.  
  2853.              Filename Completion Window:
  2854.  
  2855.                   F7 or Ctrl-Tab      (from the command line)  Open the
  2856.                                       filename completion window.
  2857.                   Up Arrow            Scroll the display up one line.
  2858.                   Down Arrow          Scroll the display down one line.
  2859.                   Left Arrow          Scroll the display left 4 columns.
  2860.                   Right Arrow         Scroll the display right 4 columns.
  2861.                   PgUp                Scroll the display up one page.
  2862.                   PgDn                Scroll the display down one page.
  2863.                   Ctrl-PgUp or Home   Go to the beginning of the filename
  2864.                                       list.
  2865.                   Ctrl-PgDn or End    Go to the end of the filename list.
  2866.                   Enter               Insert the selected filename into the
  2867.                                       command line.
  2868.  
  2869.  
  2870.              Directory Changes and CDPATH
  2871.  
  2872.              The operating system and command processor remember both a
  2873.              current or default drive for your system as a whole, and a
  2874.              current or default directory for every drive in your system.
  2875.              The current directory on the current drive is sometimes called
  2876.              the current working directory.
  2877.  
  2878.              You can change the current drive by simply typing the new
  2879.              drive letter plus a colon at the prompt.  You can change the
  2880.              current working directory with the CD command (see page 181),
  2881.              the CDD command (page 183), the PUSHD and POPD commands (pages
  2882.              47 and  299), and with automatic directory changes (page 294).
  2883.              The CD command can change the default directory on any drive,
  2884.              but it cannot change the current working directory from one
  2885.              drive to another.  The other methods of changing the current
  2886.              working directory can change both the current drive and the
  2887.              current directory in a single command.
  2888.  
  2889.  
  2890.         -------------------------------------------------------------------
  2891.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 43
  2892.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  2893.         -------------------------------------------------------------------
  2894.  
  2895.  
  2896.              Whenever you change the current working directory, 4DOS, 4OS2,
  2897.              or 4DOS/NT saves the original directory in up to three places.
  2898.              First, the directory is saved as the previous working
  2899.              directory.  You can change to the previous working directory
  2900.              with the CD - and CDD - commands (see pages 181 and 183).  You
  2901.              can use either of these commands repeatedly to switch back and
  2902.              forth between two directories.
  2903.  
  2904.              The original directory is also saved in the directory history
  2905.              (see the next topic below).  You can use this list to change
  2906.              to a recent directory with the cursor keys instead of typing a
  2907.              directory name.
  2908.  
  2909.              Finally, the PUSHD command records the old directory in the
  2910.              directory stack.  You can view the contents of this stack with
  2911.              the DIRS command and return to the directory on the top of the
  2912.              stack with the POPD command.
  2913.  
  2914.              If CD, CDD, PUSHD, or an automatic directory change can't
  2915.              locate the specified directory to change to, they will look
  2916.              for the CDPATH environment variable.  The command will append
  2917.              the specified directory name to each directory in CDPATH and
  2918.              attempt to change to that drive and directory, until the first
  2919.              match or the end of the CDPATH argument.  This allows you to
  2920.              use CDPATH as a quick way to find commonly used subdirectories
  2921.              which have unique names.  For example, if you are currently in
  2922.              the directory C:\WP\LETTERS\JANUARY and you'd like to change
  2923.              to D:\SOFTWARE\UTIL, you could enter the command:
  2924.  
  2925.                   c:\wp\letters\january> cdd d:\software\util
  2926.  
  2927.              However, if the D:\SOFTWARE directory is listed in your CDPATH
  2928.              variable, and is the first directory in the list with a UTIL
  2929.              subdirectory, you can simply enter the command
  2930.  
  2931.                   c:\wp\letters\january> cdd util
  2932.  
  2933.              to change to D:\SOFTWARE\UTIL.
  2934.  
  2935.              You can create CDPATH with the SET command.  The format of the
  2936.              CDPATH is similar to that of PATH:  a list of directories
  2937.              separated by semicolons [;].  For example, if you want the
  2938.              directory change commands to search the C:\DATA directory, the
  2939.              D:\SOFTWARE directory, and the root directory of drive E:\ for
  2940.              the subdirectories that you name, you should create CDPATH
  2941.              with this command:
  2942.  
  2943.                   c:\> set cdpath=c:\data;d:\software;e:\
  2944.  
  2945.  
  2946.  
  2947.         -------------------------------------------------------------------
  2948.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 44
  2949.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  2950.         -------------------------------------------------------------------
  2951.  
  2952.  
  2953.              Directory History Window
  2954.  
  2955.              Every time you change to a new directory or drive, the current
  2956.              directory is recorded in an internal directory history list.
  2957.              You can set the size of the list with the DirHistory directive
  2958.              in the .INI file (see page 132).  As new entries are added,
  2959.              old entries are deleted from the list.  Directory changes are
  2960.              recorded whether you make them from the command line with the
  2961.              CD, CDD, PUSHD, or POPD commands, with an automatic directory
  2962.              change, or by typing a new drive letter followed by a colon.
  2963.              Directories are recorded whether you change from one to
  2964.              another at the command line, from within a batch file, or from
  2965.              within an alias.  In order to conserve space, each directory
  2966.              name is recorded just once in the directory history, even if
  2967.              you move into and out of that directory several times.
  2968.  
  2969.              You can view the directory history from a scrollable directory
  2970.              history window and change to any drive and directory on the
  2971.              list.  To activate the directory history window, press Ctrl-
  2972.              PgUp or Ctrl-PgDn at the command line.  You can then select a
  2973.              new directory with the Enter key.
  2974.  
  2975.              Directory History Window:
  2976.  
  2977.                   Ctrl-PgUp           (from the command line) Open the
  2978.                     or Ctrl-PgDn      directory history window.
  2979.                   Up Arrow            Scroll the display up one line.
  2980.                   Down Arrow          Scroll the display down one line.
  2981.                   Left Arrow          Scroll the display left 4 columns.
  2982.                   Right Arrow         Scroll the display right 4 columns.
  2983.                   PgUp                Scroll the display up one page.
  2984.                   PgDn                Scroll the display down one page.
  2985.                   Ctrl-PgUp or Home   Go to the beginning of the directory
  2986.                                       list.
  2987.                   Ctrl-PgDn or End    Go to the end of the directory list.
  2988.                   Ctrl-D              Delete the selected line from the
  2989.                                       directory list.
  2990.                   Enter               Change to the selected drive and
  2991.                                       directory.
  2992.                   Ctrl-Enter          Move the selected line to the command
  2993.                                       line for editing.
  2994.  
  2995.  
  2996.              Local and Global Directory History
  2997.  
  2998.              The directory history can be stored in either a "local" or
  2999.              "global" list.
  3000.  
  3001.              With a local directory history list, any changes made to the
  3002.              list will only affect the current copy of the command
  3003.  
  3004.         -------------------------------------------------------------------
  3005.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 45
  3006.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3007.         -------------------------------------------------------------------
  3008.  
  3009.  
  3010.              processor.  They will not be visible in other shells, or other
  3011.              sessions.  A local directory history list is the default under
  3012.              4DOS.
  3013.  
  3014.              With a global list, all copies of the command processor will
  3015.              share the same directory history, and any changes made to the
  3016.              list in one copy will affect all other copies.  Global lists
  3017.              are the default for 4OS2 and 4DOS/NT.
  3018.  
  3019.              You can control the type of directory history list with the
  3020.              LocalDirHistory directive in the .INI file (see page 134), and
  3021.              with the /L and /LD options of the START command (see page
  3022.              331).  You can control where a global directory history list
  3023.              is stored with the UMBDirHistory directive in the .INI file
  3024.              (see page 135).
  3025.  
  3026.              There is no fixed rule for deciding whether to use a local or
  3027.              global directory history list.  Depending on your work style,
  3028.              you may find it most convenient to use one type, or a mixture
  3029.              of types in different sessions or shells.  We recommend that
  3030.              you start with the default approach for your command
  3031.              processor, then modify it if you find a situation where the
  3032.              default is not convenient.
  3033.  
  3034.     4DOS     If you select a global directory history list for 4DOS running
  3035.              under DOS, you can share the list among all copies of 4DOS.
  3036.              However, if you run 4DOS under OS/2, global lists will apply
  3037.              within each DOS session, but will not allow you to share the
  3038.              history between different DOS sessions.
  3039.  
  3040.     4OS2, ## If you select a global directory list for 4OS2 or 4DOS/NT, you
  3041.     4NT      can share the list among all copies of the command processor
  3042.              running in any session.  When you close all 4OS2 or 4DOS/NT
  3043.              sessions, the memory for the global directory history list is
  3044.              released, and a new, empty list is created the next time you
  3045.              start 4OS2 or 4DOS/NT.  If you want the list to be retained in
  3046.              memory even when no command processor session is running, you
  3047.              need to load the SHRALIAS program, which performs this service
  3048.              for the global command history, directory history, and alias
  3049.              lists.  SHRALIAS is described in more detail under the ALIAS
  3050.              command (see page 170).
  3051.  
  3052.              Whenever you start a secondary shell (see page 12) which uses
  3053.              a local directory history list, it inherits a copy of the
  3054.              directory history from the previous shell.  However, any
  3055.              changes to the list made in the secondary shell will affect
  3056.              only that shell.  If you want changes made in a secondary
  3057.              shell to affect the previous shell, use a global directory
  3058.              history list in both shells.
  3059.  
  3060.  
  3061.         -------------------------------------------------------------------
  3062.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 46
  3063.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3064.         -------------------------------------------------------------------
  3065.  
  3066.  
  3067.              Automatic Directory Changes
  3068.  
  3069.              The automatic directory change feature gives you a quick
  3070.              method for changing directories.  You can use an automatic
  3071.              directory change in place of the CD or CDD command.  To do so,
  3072.              simply type the name of the directory you want to change to at
  3073.              the prompt, with a backslash [\] at the end.  For example:
  3074.  
  3075.                   c:\> 4dos\
  3076.                   c:\4dos>
  3077.  
  3078.              This feature can make directory changes very simple when it's
  3079.              combined with the CDPATH environment variable (see page 44).
  3080.              CDPATH is a list of directories for the CD and CDD commands to
  3081.              search if the directory you name does not exist below the
  3082.              current directory.  Automatic directory changes use CDPATH as
  3083.              well.  For example, suppose CDPATH is set to C:\;D:\;E:\, and
  3084.              the directory WIN exists on drive E:.  You can change to this
  3085.              directory with a single word on the command line:
  3086.  
  3087.                   c:\4dos> win\
  3088.                   e:\win>
  3089.  
  3090.              In executing the command shown above, the command processor
  3091.              first looks for a WIN subdirectory of the current directory,
  3092.              i.e., C:\4DOS\WIN.  If no such directory exists it looks for a
  3093.              WIN subdirectory in every directory in the CDPATH list, and
  3094.              changes to the first one it finds.
  3095.  
  3096.              Internally, automatic directory changes use the CDD command,
  3097.              so the text before the backslash can include a drive letter, a
  3098.              full path, or a partial path.  Commands like "....\" can be
  3099.              used to move up the directory tree quickly (see page 59).
  3100.              Automatic directory changes save the current directory, so it
  3101.              can be recalled with a "CDD -" or "CD -" command.  For more
  3102.              information on directory changes see page 181, CD on page 44,
  3103.              and CDD on page 183.
  3104.  
  3105.  
  3106.              Multiple Commands
  3107.  
  3108.              At times, you probably know the next two or three commands
  3109.              that you want to execute.  Instead of waiting for each one to
  3110.              finish before you type the next, you can type them all on the
  3111.              same command line, separated by a caret [^] in 4DOS, or an
  3112.              ampersand [&] in 4OS2 or 4DOS/NT.  For example, if you know
  3113.              you want to copy all of your .TXT files to drive A: and then
  3114.              run CHKDSK to be sure that drive A's file structure is in good
  3115.              shape, in 4DOS you could enter the following command:
  3116.  
  3117.  
  3118.         -------------------------------------------------------------------
  3119.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 47
  3120.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3121.         -------------------------------------------------------------------
  3122.  
  3123.  
  3124.                   c:\> copy *.txt a: ^ chkdsk a:
  3125.  
  3126.              You may put as many commands on the command line as you wish,
  3127.              as long as the total length of the command line does not
  3128.              exceed 255 characters in 4DOS or 1023 characters in 4OS2 and
  3129.              4DOS/NT.
  3130.  
  3131.              You can use multiple commands in batch files (see page 80) and
  3132.              alias definitions (see page 77) as well as from the command
  3133.              line.
  3134.  
  3135.              If you don't like using the default command separator, you can
  3136.              pick another character using the SETDOS /C command (see page
  3137.              323) or the CommandSep directive in the .INI file (see page
  3138.              137).  If you plan to share aliases or batch files between
  3139.              4DOS, 4OS2, and 4DOS/NT, see page 74 for details about
  3140.              choosing compatible command separators for two or more
  3141.              products.
  3142.  
  3143.  
  3144.              Temporarily Disabling Aliases
  3145.  
  3146.              Aliases can be used to create shorthand names for commonly
  3147.              used commands, or to define default options for existing
  3148.              commands (for more information see pages 161 and 77).  At
  3149.              times, you may want to temporarily disable an alias that you
  3150.              have defined.  You may have an alias that changes the defaults
  3151.              of a particular command, for example, and want to run the
  3152.              unmodified version of the command.  To do so, precede the
  3153.              command name with an asterisk [*].  For example, if you have
  3154.              an alias for DIR which displays directories in 2-column paged
  3155.              mode by default, you can use the following command to display
  3156.              a directory in the normal single-column, non-paged mode:
  3157.  
  3158.                   c:\> *dir
  3159.  
  3160.              You can also disable aliases temporarily with the SETDOS /X
  3161.              command (see page 327).
  3162.  
  3163.  
  3164.              Command Line Help
  3165.  
  3166.              All of our products include complete online help.  You can
  3167.              start the help system by typing HELP or HELP plus a command
  3168.              name at the prompt, or by pressing the F1 key at any time at
  3169.              the command line.
  3170.  
  3171.     4DOS     In 4DOS,a special program (4HELP.EXE) displays the online
  3172.              help.  If you press F1, the 4DOS help system will display the
  3173.  
  3174.  
  3175.         -------------------------------------------------------------------
  3176.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 48
  3177.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3178.         -------------------------------------------------------------------
  3179.  
  3180.  
  3181.              list of all help topics just as if you had entered the HELP
  3182.              command.
  3183.  
  3184.     4OS2,    In 4OS2 and 4DOS/NT, the online help uses the operating
  3185.     4NT      system's built-in help facility.  If you press F1, the table
  3186.              of contents will be displayed and you can select the desired
  3187.              help topic using the standard help "navigation" keys for your
  3188.              system.
  3189.  
  3190.              If you have already typed part or all of a command on the
  3191.              line, the help system will provide "context-sensitive" help by
  3192.              using the first word on the line as a help topic.  If it's a
  3193.              valid topic, you will see help for that topic automatically;
  3194.              if not, you will see the list of all help topics (in 4DOS) or
  3195.              the table of contents (in 4OS2 and 4DOS/NT), and you can then
  3196.              pick the topic you want.  For example, if you press F1 after
  3197.              entering each of the command lines shown below you will get
  3198.              the display indicated:
  3199.  
  3200.                   c:\>                     Topic list / table of contents
  3201.                   c:\> copy *.* a:         Help on COPY
  3202.                   c:\> c:\util\map         Topic list / table of contents
  3203.  
  3204.              If you type the name of any internal command at the prompt,
  3205.              followed by a slash and a question mark [/?] like this:
  3206.  
  3207.                   copy /?
  3208.  
  3209.              then you will see help for the command in a "quick-reference"
  3210.              style.  Output from a /? display may be redirected with > or
  3211.              >> (see page 52).  The /? option may not work correctly if you
  3212.              have redefined how the command operates with an alias.  In
  3213.              this case you may need to add an asterisk to the beginning of
  3214.              the command to disable alias processing:
  3215.  
  3216.                   alias copy copy /r
  3217.                   *copy /?
  3218.  
  3219.              /? will only access the help system when you use it with an
  3220.              internal command.  If you use it with an external command
  3221.              name, the external command will be executed and will interpret
  3222.              the /? parameter according to its own rules.  Some external
  3223.              commands, including some DOS and OS/2 external utility
  3224.              programs, do display help when run with a /? parameter, but
  3225.              this a characteristic of these commands and does not depend on
  3226.              the command processor.  Many other external commands do not
  3227.              have this feature.
  3228.  
  3229.              Please see the Introduction and Installation Guide that was
  3230.              supplied with your version of 4DOS, 4OS2, or 4DOS/NT for a
  3231.  
  3232.         -------------------------------------------------------------------
  3233.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 49
  3234.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3235.         -------------------------------------------------------------------
  3236.  
  3237.  
  3238.              more thorough explanation of the online Help available with
  3239.              the program you use.
  3240.  
  3241.  
  3242.          ##  Command-Line Length Limits
  3243.  
  3244.              Under 4DOS, when you first enter a command at the prompt or in
  3245.              an alias or batch file, it can be up to 255 characters long.
  3246.              The 4OS2 and 4DOS/NT command lines can hold 1,023 characters.
  3247.  
  3248.              As the command processor scans the command line and
  3249.              substitutes the contents of aliases and environment variables
  3250.              for their names, the line usually gets longer.  This expanded
  3251.              line is stored in an internal buffer which allows each
  3252.              individual command to grow to 255 characters during the
  3253.              expansion process (1,023 characters in 4OS2 and 4DOS/NT).  In
  3254.              addition, if you have multiple commands on a single line,
  3255.              during expansion the entire line can grow to as much as 511
  3256.              characters in 4DOS, or 2,047 characters in 4OS2 and 4DOS/NT.
  3257.              If your use of aliases or environment variables causes the
  3258.              command line to exceed either of these limits as it is
  3259.              expanded, you will see an error message and the remainder of
  3260.              the line will not be executed.
  3261.  
  3262.  
  3263.         Page and File Prompts
  3264.  
  3265.              Several 4DOS, 4OS2, and 4DOS/NT commands can generate prompts,
  3266.              which wait for you to press a key to view a new page or to
  3267.              perform a file activity.
  3268.  
  3269.              When 4DOS, 4OS2, or 4DOS/NT is displaying information in page
  3270.              mode, for example with a DIR /P or SET /P command, it displays
  3271.              the message
  3272.  
  3273.                   Press Esc to Quit or any other key to continue...
  3274.  
  3275.              At this prompt, you can press Esc, Ctrl-C, or Ctrl-Break if
  3276.              you want to quit the command.  You can press almost any other
  3277.              key to continue with the command and see the next page of
  3278.              information.
  3279.  
  3280.              During file processing, if you have activated prompting with a
  3281.              command like DEL /P, you will see this prompt before
  3282.              processing every file:
  3283.  
  3284.                   Y/N/R ?
  3285.  
  3286.              You can answer this prompt by pressing "Y" for "Yes, process
  3287.              this file;"  "N" for "No, do not process this file;"  or "R"
  3288.  
  3289.         -------------------------------------------------------------------
  3290.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 50
  3291.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3292.         -------------------------------------------------------------------
  3293.  
  3294.  
  3295.              for "process the Remainder of the files without further
  3296.              prompting."  You can also press Ctrl-C or Ctrl-Break at this
  3297.              prompt to cancel the remainder of the command.
  3298.  
  3299.              If you press Ctrl-C or Ctrl-Break while a batch file is
  3300.              running, you will see a "Cancel batch job" prompt.  For
  3301.              information on responses to this prompt see page 85.
  3302.  
  3303.  
  3304.         Critical Errors
  3305.  
  3306.              DOS, OS/2, and Windows NT all watch for physical errors during
  3307.              input and output operations.  Physical errors are those due to
  3308.              hardware problems, such as trying to read a floppy disk while
  3309.              the drive door is open.
  3310.  
  3311.              These errors are called critical errors because the operating
  3312.              system, command processor, or application program cannot
  3313.              proceed until the error is resolved.
  3314.  
  3315.              When a critical error occurs, you will see a message asking
  3316.              you to choose one of four error handling options.  The message
  3317.              comes from the command processor or the operating system, and
  3318.              will vary slightly depending on your operating system and
  3319.              (under OS/2 and Windows NT) whether you are in full-screen or
  3320.              windowed mode.  You can respond with a single character (under
  3321.              DOS), or a mouse click or menu selection (under OS/2 or
  3322.              Windows NT).  However, the options and their meanings are
  3323.              similar in all cases:
  3324.  
  3325.                   Retry  Retry the operation.  Choose this option if you
  3326.                          have corrected the problem.
  3327.  
  3328.                   Ignore Ignore the error and continue.  Use caution when
  3329.                          choosing this option.  Ignoring critical errors,
  3330.                          especially on the hard disk, can cause errors in
  3331.                          your applications or damage data on the disk.
  3332.  
  3333.                   Fail   Tell the program that the operation failed.  This
  3334.                          option returns an error code to the command
  3335.                          processor or to the application program that was
  3336.                          running when the error occurred.  4DOS, 4OS2, and
  3337.                          4DOS/NT generally stop the current command when
  3338.                          an operation fails.  This option is not available
  3339.                          for all errors; if you don't see it, use Abort
  3340.                          instead.  Under DOS, you can force a Fail
  3341.                          response to all critical errors with the CritFail
  3342.                          directive in 4DOS.INI (see page 148).
  3343.  
  3344.  
  3345.  
  3346.         -------------------------------------------------------------------
  3347.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 51
  3348.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3349.         -------------------------------------------------------------------
  3350.  
  3351.  
  3352.                   Abort  Abort the program.  Choose this option to stop
  3353.                          the program that was running when the error
  3354.                          occurred.  Choosing Abort after an error in 4DOS,
  3355.                          4DOS/NT, or the 16-bit version of 4OS2 will abort
  3356.                          the command, but not the command processor
  3357.                          itself.  Choosing Abort after an error in the 32-
  3358.                          bit version of 4OS2 will abort both the command
  3359.                          and the command processor.  To avoid this, use
  3360.                          Fail rather than Abort if possible.
  3361.  
  3362.  
  3363.         Input and Output
  3364.  
  3365.              Internal commands and many external programs get their input
  3366.              from the computer's standard input device and send their
  3367.              output to the standard output device.  Some programs also send
  3368.              special messages to the standard error device.  Normally, the
  3369.              keyboard is used for standard input and the video screen for
  3370.              both standard output and standard error, but you can
  3371.              temporarily change these assignments for special tasks.
  3372.  
  3373.              For example, suppose you want a printed list of the files in a
  3374.              directory.  If you change the standard output to the printer
  3375.              and issue a DIR command, the task is easy.  DIR prints to
  3376.              standard output, and you have redirected standard output to
  3377.              the printer, so the DIR command prints filenames instead of
  3378.              displaying them on the screen.  You can just as easily send
  3379.              the output of DIR (or any other command) to a file or a serial
  3380.              port.
  3381.  
  3382.              We offer three methods of manipulating input and output:
  3383.              Redirection, Piping, and (under 4DOS) the Keystack.  All three
  3384.              are explained in this section.
  3385.  
  3386.              Redirection and piping affect the standard input, standard
  3387.              output, and standard error devices.  They do not work with
  3388.              application programs which read the keyboard hardware
  3389.              directly, or which write directly to the screen.
  3390.  
  3391.  
  3392.              Redirection
  3393.  
  3394.              Redirection assigns standard input, standard output, and
  3395.              standard error to a device like the printer or serial port, or
  3396.              to a file.  (You must use some discretion when you use
  3397.              redirection with a device; there is no way to get input from
  3398.              the printer, for example.)
  3399.  
  3400.              Redirection always applies to a specific command, and lasts
  3401.              only for the duration of that command.  When the command is
  3402.  
  3403.         -------------------------------------------------------------------
  3404.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 52
  3405.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3406.         -------------------------------------------------------------------
  3407.  
  3408.  
  3409.              finished, the assignments for standard input, standard output,
  3410.              and standard error revert to whatever they were before the
  3411.              command.
  3412.  
  3413.              In the descriptions below, filename means either the name of a
  3414.              file or of an appropriate device (PRN, LPT1, LPT2, or LPT3 for
  3415.              printers; COM1 to COM4 for serial ports; CON for the keyboard
  3416.              and screen; etc.).
  3417.  
  3418.              To use redirection, place the redirection symbol and filename
  3419.              at the end of the command line, after the command name and any
  3420.              parameters.  For example, to redirect the output of the DIR
  3421.              command to a file called DIRLIST, you could use a command line
  3422.              like this:
  3423.  
  3424.                   c:\> dir /b *.dat > dirlist
  3425.  
  3426.              You can use both input and output redirection for the same
  3427.              command, if both are appropriate:
  3428.  
  3429.                   c:\> sort < dirlist > dirlist.srt
  3430.  
  3431.              If you redirect the output of a single internal command like
  3432.              DIR, the redirection ends automatically when that command is
  3433.              done.  If you start a batch file with redirection, all of the
  3434.              batch file's output is redirected, and redirection ends when
  3435.              the batch file is done.  Similarly, if you use redirection at
  3436.              the end of a command group (see page 71), all of the output
  3437.              from the command group is redirected, and redirection ends
  3438.              when the command group is done.
  3439.  
  3440.              Here are the redirection options supported by 4DOS, 4OS2, and
  3441.              4DOS/NT:
  3442.  
  3443.                   To get input from a file or device instead of from the
  3444.                   keyboard:
  3445.  
  3446.                        < filename
  3447.  
  3448.                   To redirect standard output to a file or device:
  3449.  
  3450.                        > filename
  3451.  
  3452.                   To redirect standard output and standard error to a file
  3453.                   or device:
  3454.  
  3455.                        >& filename
  3456.  
  3457.                   To redirect standard error only to a file or device:
  3458.  
  3459.  
  3460.         -------------------------------------------------------------------
  3461.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 53
  3462.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3463.         -------------------------------------------------------------------
  3464.  
  3465.  
  3466.                        >&> filename
  3467.  
  3468.              If you want to append output to the end of an existing file,
  3469.              rather than creating a new file, replace the first ">" in the
  3470.              last three commands above with ">>" (use >>, >>&, and >>&>).
  3471.  
  3472.          ##  When output is directed to a file with >, >&, or >&>, if the
  3473.              file already exists, it will be overwritten.  You can protect
  3474.              existing files by using the SETDOS /N1 command (see page 325)
  3475.              or the NoClobber directive in the .INI file (see page 140).
  3476.  
  3477.          ##  When output is appended to a file with >>, >>&, or >>&>, the
  3478.              file will be created if it doesn't already exist.  Setting
  3479.              NoClobber will also prevent the creation of a new file.
  3480.  
  3481.          ##  You can temporarily override the current setting of NoClobber
  3482.              by using an exclamation mark [!] after the redirection symbol.
  3483.              For example, to redirect the output of DIR to the file DIROUT,
  3484.              and allow overwriting of any existing file despite the
  3485.              NoClobber setting:
  3486.  
  3487.                   c:\> dir >! dirout
  3488.  
  3489.          ##  Redirection is fully nestable.  For example, you can invoke a
  3490.              batch file and redirect all of its output to a file or device.
  3491.              Output redirection on a command within the batch file will
  3492.              take effect for that command only; when the command is
  3493.              completed, output will revert to the redirected output file or
  3494.              device in use for the batch file as a whole.
  3495.  
  3496.          ##  You can use redirection if you need to create a zero-byte
  3497.              file.  To do so, enter  >filename as a command, with no actual
  3498.              command before the > character.
  3499.  
  3500.    4DOS  ##  For another method of changing the standard input and output
  3501.              devices see CTTY on page 194.
  3502.  
  3503.     4OS2,    In addition to the extended 4DOS redirection options, 4OS2 and
  3504.     4NT      4DOS/NT also support the OS/2 and Windows NT CMD.EXE syntax
  3505.  
  3506.                        n>file
  3507.  
  3508.              and
  3509.  
  3510.                        n>&m
  3511.  
  3512.              where [n] and [m] are digits between 0 and 9.  You may not put
  3513.              any spaces between the n and the >, or between the >, &, and m
  3514.              in the second form.   The digits represent file handles; OS/2
  3515.              and Windows NT interpret "0" as standard input, "1" as
  3516.  
  3517.         -------------------------------------------------------------------
  3518.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 54
  3519.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3520.         -------------------------------------------------------------------
  3521.  
  3522.  
  3523.              standard output, and "2" as standard error.  Handles 3 to 9
  3524.              will probably not be useful unless you have an application
  3525.              which uses those handles for a specific, documented purpose,
  3526.              or have opened a file with the %@FILEOPEN variable function
  3527.              (see page 114) and the file handle is between 3 and 9.
  3528.  
  3529.              The n>file syntax redirects output from handle n to a file.
  3530.              You can use this form to redirect two handles to different
  3531.              places.  For example:
  3532.  
  3533.                   [c:\] dir > outfile 2> errfile
  3534.  
  3535.              sends normal output to a file called OUTFILE and any error
  3536.              messages to a file called ERRFILE.
  3537.  
  3538.              The n>&m syntax redirects handle n to the same location as the
  3539.              previously assigned handle m.  For example, to send standard
  3540.              error to the same file as standard output, you could use this
  3541.              command:
  3542.  
  3543.                   [c:\] dir > outfile 2>&1
  3544.  
  3545.              Notice that you can perform the same operations by using 4OS2
  3546.              or 4DOS/NT's enhanced redirection features.  The two examples
  3547.              above could be written as
  3548.  
  3549.                   [c:\] dir > outfile >&> errfile
  3550.  
  3551.              and
  3552.  
  3553.                   [c:\] dir >&outfile
  3554.  
  3555.  
  3556.              Piping
  3557.  
  3558.              You can also create a "pipe," which means sending the standard
  3559.              output of one command to the standard input of another
  3560.              command.  To send the standard output of command1 to the
  3561.              standard input of command2:
  3562.  
  3563.                   command1 | command2
  3564.  
  3565.              To send the standard output and standard error of command1 to
  3566.              the standard input of command2:
  3567.  
  3568.                   command1 |& command2
  3569.  
  3570.              For example, to take the output of the SET command (which
  3571.              displays a list of your environment variables and their
  3572.  
  3573.  
  3574.         -------------------------------------------------------------------
  3575.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 55
  3576.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3577.         -------------------------------------------------------------------
  3578.  
  3579.  
  3580.              values) and pipe it to the SORT utility to generate a sorted
  3581.              list, you would use the command:
  3582.  
  3583.                   c:\> set | sort
  3584.  
  3585.              To do the same thing and then pipe the sorted list to the
  3586.              internal LIST command for full-screen viewing (see page 272):
  3587.  
  3588.                   c:\> set | sort | list /s
  3589.  
  3590.          ##  The TEE and Y commands (see pages 340 and 358) are "pipe
  3591.              fittings" which add more flexibility to pipes.
  3592.  
  3593.          ##  Like redirection, pipes are fully nestable.  For example, you
  3594.              can invoke a batch file and send all of its output to another
  3595.              command with a pipe.  A pipe on a command within the batch
  3596.              file will take effect for that command only; when the command
  3597.              is completed, output will revert to the pipe in use for the
  3598.              batch file as a whole.  You may also have 2 or more pipes
  3599.              operating simultaneously if, for example, you have the pipes
  3600.              running in different windows in a multitasking system.
  3601.  
  3602.    4DOS  ##  4DOS creates one or two temporary files to hold the output of
  3603.              pipes.  The files are given unique names.  By default, these
  3604.              files are stored in the root directory of the boot drive, but
  3605.              you can override this with either the TEMP4DOS or TEMP
  3606.              environment variable (see page 100).
  3607.  
  3608.    4OS2, ##  4OS2 and 4DOS/NT implement pipes by starting a new process for
  3609.    4NT       the receiving program instead of using temporary files.  The
  3610.              sending and receiving programs run simultaneously; the sending
  3611.              program writes to the pipe and the receiving program reads
  3612.              from the pipe.  When the receiving program finishes reading
  3613.              and processing the piped data, it is ended automatically.
  3614.  
  3615.              If you are used to using pipes under 4DOS, you normally will
  3616.              not see any difference with a 4OS2 or 4DOS/NT pipe except
  3617.              perhaps less disk activity.  But you may not get the results
  3618.              you expect if you use a pipe command like:
  3619.  
  3620.                        [c:\] echo test | input %%var
  3621.  
  3622.     4DOS     In 4DOS, this pipe will create an environment variable called
  3623.              VAR and set its value as "test."  You will be able to see the
  3624.              new variable by typing SET at the prompt.
  3625.  
  3626.     4OS2,    In 4OS2 and 4DOS/NT, VAR will be set in the environment that
  3627.     4NT      belongs to the receiving program.  But that environment will
  3628.              be discarded when the pipe has been emptied and the process
  3629.              ends.  You will never see VAR in the environment even though
  3630.  
  3631.         -------------------------------------------------------------------
  3632.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 56
  3633.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3634.         -------------------------------------------------------------------
  3635.  
  3636.  
  3637.              the command processor and the operating system are both
  3638.              operating correctly.
  3639.  
  3640.              The same cautions apply to the "pipe-fitting" commands, TEE
  3641.              and Y.  When you use pipes with 4OS2 or 4DOS/NT, make sure you
  3642.              think about any possible consequences that can occur from
  3643.              using a separate process to run the receiving program.
  3644.  
  3645.  
  3646.     4DOS     Keystack
  3647.  
  3648.              The 4DOS Keystack overcomes two weaknesses of input
  3649.              redirection:  many programs ignore standard input and read the
  3650.              keyboard directly, and input redirection doesn't end until the
  3651.              program or command terminates.  You can't, for example, use
  3652.              redirection to send the opening commands to a program and then
  3653.              type the rest of the commands yourself.  But the Keystack lets
  3654.              you do exactly that.
  3655.  
  3656.              The 4DOS Keystack sends keystrokes to an application program.
  3657.              Once the Keystack is empty, the program will receive the rest
  3658.              of its input from the keyboard.  The Keystack is useful when
  3659.              you want a program to take certain actions automatically when
  3660.              it starts.  It is most often used in batch files and aliases.
  3661.  
  3662.              The Keystack is invoked with the KEYSTACK command (see page
  3663.              266).  It depends on a small resident program called
  3664.              KSTACK.COM, which may be installed from your AUTOEXEC.BAT file
  3665.              (see page 86).  If you don't have KSTACK.COM installed, the
  3666.              KEYSTACK command will display an error message.  If you are
  3667.              using a multitasking system such as DESQview or Windows, see
  3668.              your 4DOS Introduction and Installation Guide for information
  3669.              on loading KSTACK within a window.
  3670.  
  3671.              To place the letters, digits, and punctuation marks you would
  3672.              normally type for your program into the keystack, enclose them
  3673.              in double quotes:
  3674.  
  3675.                   c:\> keystack "myfile"
  3676.  
  3677.              Many other keys can be entered into the Keystack using their
  3678.              names.  This example puts the F1 key followed by the Enter key
  3679.              in the keystack:
  3680.  
  3681.                   c:\> keystack F1 Enter
  3682.  
  3683.              See page 31 for details on how key names are entered.  See the
  3684.              KEYSTACK command on page 266 for information on using numeric
  3685.              key values along with or instead of key names, and other
  3686.              details about using the Keystack.
  3687.  
  3688.         -------------------------------------------------------------------
  3689.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 57
  3690.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3691.         -------------------------------------------------------------------
  3692.  
  3693.  
  3694.              The following command creates an alias (see page 161) that
  3695.              will run a dBASE report called TIMEREP (it should be entered
  3696.              on one line):
  3697.  
  3698.                   c:\> alias drpt `keystack "use times index times" Enter
  3699.                        "report form timerep to print" Enter "quit" Enter
  3700.                         ^ dbase`
  3701.  
  3702.              This command creates an alias called DRPT which puts the
  3703.              following characters on the keystack:
  3704.  
  3705.                   the characters "use times index times"
  3706.                   the Enter key's code
  3707.                   the characters "report form timerep to print"
  3708.                   the Enter key's code
  3709.                   the characters "quit"
  3710.                   and one more Enter key
  3711.  
  3712.              The alias then runs the program dBASE which receives those
  3713.              characters just as if you had typed them.
  3714.  
  3715.              When you use the Keystack, remember that you must put the
  3716.              keystrokes into the Keystack before you run the program that
  3717.              will receive them.  The Keystack will hold the keystrokes
  3718.              until the program asks for them.
  3719.  
  3720.  
  3721.         File Selection
  3722.  
  3723.              Most internal commands (like COPY, DIR, etc.) work on a file
  3724.              or a group of files.  Besides typing the exact name of the
  3725.              file you want to work with, you can use several shorthand
  3726.              forms for naming or selecting files:  Extended Parent
  3727.              Directory Names; Wildcards; Date, Time, and Size Ranges;
  3728.              Multiple Filenames; Include Lists; and Executable Extensions.
  3729.              These six features are explained in this section.
  3730.  
  3731.              These features apply to 4DOS, 4OS2, and 4DOS/NT commands only,
  3732.              and generally can not be used to pass file names to external
  3733.              programs.  For example, the file name ...\FILE.DAT uses an
  3734.              extended parent directory name ("...").  It can be used in an
  3735.              internal command like COPY or MOVE.  However, your editor
  3736.              probably was not designed to support this extension to
  3737.              traditional directory names, and is likely to give an error
  3738.              message if you try to pass it such a name.
  3739.  
  3740.              Remember throughout this section that, if you are using DOS,
  3741.              or the FAT file system under OS/2 or Windows NT, a filename is
  3742.              a base name of 1 to 8 characters, optionally followed by an
  3743.              extension which is a period [.] and 1 to 3 more characters.
  3744.  
  3745.         -------------------------------------------------------------------
  3746.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 58
  3747.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3748.         -------------------------------------------------------------------
  3749.  
  3750.  
  3751.              On an HPFS or NTFS drive, file names can contain up to 255
  3752.              characters, including spaces.  If an HPFS or NTFS filename
  3753.              includes spaces, you must place it in quotation marks on the
  3754.              command line.  (See page  13 for additional details on
  3755.              filename formats and restrictions.)
  3756.  
  3757.  
  3758.              Extended Parent Directory Names
  3759.  
  3760.              4DOS, 4OS2, and 4DOS/NT allow you to extend the traditional
  3761.              DOS ".." syntax for naming the parent directory, by adding
  3762.              additional [.] characters.  Each additional [.] represents an
  3763.              additional directory level above the current directory.  For
  3764.              example, .\FILE.DAT refers to a file in the current directory,
  3765.              ..\FILE.DAT refers to a file one level up (in the parent
  3766.              directory), and ...\FILE.DAT refers to a file two levels up
  3767.              (in the parent of the parent directory).  If you are in the
  3768.              C:\DATA\FINANCE\JANUARY directory and want to copy the file
  3769.              LETTERS.DAT from the directory C:\DATA to drive A:
  3770.  
  3771.                   C:\DATA\FINANCE\JANUARY>copy ...\LETTERS.DAT A:
  3772.  
  3773.  
  3774.              Wildcards
  3775.  
  3776.              Wildcards let you specify a file or group of files by typing a
  3777.              partial filename.  The appropriate directory is scanned to
  3778.              find all of the files that match the partial name you have
  3779.              specified.
  3780.  
  3781.              Most internal commands accept filenames with wildcards
  3782.              anywhere that a full filename can be used.  There are two
  3783.              wildcard characters, the asterisk [*] and the question mark
  3784.              [?], plus a special method of specifying a range of
  3785.              permissible characters.
  3786.  
  3787.              An asterisk [*] in a filename means "any zero or more
  3788.              characters in this position."  For example, this command will
  3789.              display a list of all files in the current directory:
  3790.  
  3791.                   c:\> dir *.*
  3792.  
  3793.              If you want to see all of the files with a .TXT extension, you
  3794.              could type this:
  3795.  
  3796.                   c:\> dir *.txt
  3797.  
  3798.              If you know that the file you are looking for has a base name
  3799.              that begins with ST and an extension that begins with .D, you
  3800.  
  3801.  
  3802.         -------------------------------------------------------------------
  3803.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 59
  3804.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3805.         -------------------------------------------------------------------
  3806.  
  3807.  
  3808.              can find it this way.  Filenames such as STATE.DAT,
  3809.              STEVEN.DOC, and ST.D will all be displayed:
  3810.  
  3811.                   c:\> dir st*.d*
  3812.  
  3813.              With 4DOS, 4OS2, or 4DOS/NT, you can also use the asterisk to
  3814.              match filenames with specific letters somewhere inside the
  3815.              name.  The following example will display any file with a .TXT
  3816.              extension that has the letters AM together anywhere inside its
  3817.              base name.  It will, for example, display AMPLE.TXT,
  3818.              STAMP.TXT, CLAM.TXT, and AM.TXT:
  3819.  
  3820.                   c:\> dir *am*.txt
  3821.  
  3822.              A question mark [?] matches any single filename character.
  3823.              You can put the question mark anywhere in a filename and use
  3824.              as many question marks as you need.  The following example
  3825.              will display files with names like LETTER.DOC and LATTER.DAT,
  3826.              and LITTER.DU:
  3827.  
  3828.                   c:\> dir l?tter.d??
  3829.  
  3830.              The use of an asterisk wildcard before other characters, and
  3831.              of the character ranges discussed below, are enhancements to
  3832.              the standard wildcard syntax, and are not likely to work
  3833.              properly with software other than 4DOS, 4OS2, and 4DOS/NT.
  3834.  
  3835.          ##  "Extra" question marks in your wildcard specification are
  3836.              ignored if the file name is shorter than the wildcard
  3837.              specification.  For example, if you have files called
  3838.              LETTER.DOC, LETTER1.DOC, and LETTERA.DOC, this command will
  3839.              display all three names:
  3840.  
  3841.                   c:\> dir letter?.doc
  3842.  
  3843.              The file LETTER.DOC is included in the display because the
  3844.              "extra" question mark at the end of "LETTER?" is ignored when
  3845.              matching the shorter name LETTER.
  3846.  
  3847.          ##  In some cases, the question mark wildcard may be too general.
  3848.              You can also specify what characters you want to accept (or
  3849.              exclude) in a particular position in the filename by using
  3850.              square brackets.  Inside the brackets, you can put the
  3851.              individual acceptable characters or ranges of characters.  For
  3852.              example, if you wanted to match LETTER0.DOC through
  3853.              LETTER9.DOC, you could use this command:
  3854.  
  3855.                   c:\> dir letter[0-9].doc
  3856.  
  3857.  
  3858.  
  3859.         -------------------------------------------------------------------
  3860.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 60
  3861.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3862.         -------------------------------------------------------------------
  3863.  
  3864.  
  3865.              You could find all files that have a vowel as the second
  3866.              letter in their name this way.  This example also demonstrates
  3867.              how to mix the wildcard characters:
  3868.  
  3869.                   c:\> dir ?[aeiouy]*.*
  3870.  
  3871.              You can exclude a group of characters or a range of characters
  3872.              by using an exclamation mark [!] as the first character inside
  3873.              the brackets.  This example displays all filenames that are at
  3874.              least 2 characters long except those which have a vowel as the
  3875.              second letter in their names:
  3876.  
  3877.                   c:\> dir ?[!aeiouy]*.*
  3878.  
  3879.              The next example, which selects files such as AIP, BIP, and
  3880.              TIP but not NIP, demonstrates how you can use multiple ranges
  3881.              inside the brackets.  It will accept a file that begins with
  3882.              an A, B, C, D, T, U, or V:
  3883.  
  3884.                   c:\> dir [a-dt-v]ip
  3885.  
  3886.          ##  You may use a question mark character inside the brackets, but
  3887.              its meaning is slightly different than a normal (unbracketed)
  3888.              question mark wildcard.  A normal question mark wildcard
  3889.              matches any character, but will be ignored when matching a
  3890.              name shorter than the wildcard specification, as described
  3891.              above.  A question mark inside brackets will match any
  3892.              character, but will not be discarded when matching shorter
  3893.              filenames.  For example:
  3894.  
  3895.                   c:\> dir letter[?].doc
  3896.  
  3897.              will display LETTER1.DOC and LETTERA.DOC, but not LETTER.DOC.
  3898.  
  3899.          ##  A pair of brackets with no characters between them [], or an
  3900.              exclamation point and question mark together [!?],will match
  3901.              only if there is no character in that position.  For example,
  3902.  
  3903.                   [c:\] dir letter[].doc
  3904.  
  3905.              will not display LETTER1.DOC or LETTERA.DOC, but will display
  3906.              LETTER.DOC.  This is most useful for commands like
  3907.  
  3908.                   [c:\] dir /I"[]" *.btm
  3909.  
  3910.              which will display a list of all .BTM files which don't have a
  3911.              description.
  3912.  
  3913.          ##  You can repeat any of the wildcard characters in any
  3914.              combination you desire within a single file name.  For
  3915.  
  3916.         -------------------------------------------------------------------
  3917.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 61
  3918.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3919.         -------------------------------------------------------------------
  3920.  
  3921.  
  3922.              example, the following command lists all files which have an
  3923.              A, B, or C as the third character, followed by zero or more
  3924.              additional characters, followed by a D, E, or F, followed
  3925.              optionally by some additional characters, and with an
  3926.              extension beginning with P or Q.  You probably won't need to
  3927.              do anything this complex, but we've included it to show you
  3928.              the flexibility of extended wildcards:
  3929.  
  3930.                   c:\> dir ??[abc]*[def]*.[pq]*
  3931.  
  3932.    4OS2, ##  You can also use the square bracket wildcard syntax to work
  3933.    4NT       around a conflict between HPFS and NTFS filenames containing
  3934.              semicolons [;], and the use of a semicolon to indicate an
  3935.              include list (see page 67).  For example, if you have a file
  3936.              on an HPFS drive named C:\DATA\LETTER1;V2 and you enter this
  3937.              command:
  3938.  
  3939.                   [c:\] del \data\letter1;v2
  3940.  
  3941.              you will not get the results you expect.  Instead of deleting
  3942.              the named file, 4OS2 or 4DOS/NT will attempt to delete LETTER1
  3943.              and then V2, because the semicolon indicates an include list.
  3944.              However if you use square brackets around the semicolon it
  3945.              will be interpreted as a filename character, and not as an
  3946.              include list separator.  For example, this command would
  3947.              delete C:\DATA\LETTER1;V2:
  3948.  
  3949.                   [c:\] del \data\letter1[;]v2
  3950.  
  3951.  
  3952.              Date, Time, and Size Ranges
  3953.  
  3954.              Most internal commands which accept wild cards also allow
  3955.              date, time, and size ranges to further define the files that
  3956.              you wish to work with.  4DOS, 4OS2, and 4DOS/NT will examine
  3957.              the files' timestamps (which record when the file was last
  3958.              modified), and the files' sizes, to determine which files meet
  3959.              the range criteria that you specify.
  3960.  
  3961.              A range begins with the switch character (usually a slash
  3962.              [/]), followed by a left square bracket ("[") and a character
  3963.              that specifies the range type:  "s" for a size range, "d" for
  3964.              a date range, or "t" for a time range.  The "s", "d", or "t"
  3965.              is followed by a start value, and an optional comma and end
  3966.              value.  The range ends with a right square bracket ("]").
  3967.  
  3968.  
  3969.  
  3970.  
  3971.  
  3972.  
  3973.         -------------------------------------------------------------------
  3974.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 62
  3975.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  3976.         -------------------------------------------------------------------
  3977.  
  3978.  
  3979.              Size Ranges
  3980.  
  3981.              Size ranges simply select files whose size is between the
  3982.              limits given.  For example, /[s10000,20000] selects files
  3983.              between 10,000 and 20,000 bytes long.
  3984.  
  3985.              Either or both values in a size range can end with "k" to
  3986.              indicate thousands of bytes, "K" to indicate kilobytes (1,024
  3987.              bytes), "m" to indicate millions of bytes, or "M" to indicate
  3988.              megabytes (1,048,576 bytes).  For example, the range above
  3989.              could be rewritten as /[s10k,20k].
  3990.  
  3991.              All ranges are inclusive.  Both examples above will match
  3992.              files that are exactly 10,000 bytes and 20,000 bytes long, as
  3993.              well as all sizes in between.
  3994.  
  3995.              The second argument of a size range is optional.  If you use a
  3996.              single argument, like /[s10k], you will select files of that
  3997.              size or larger.  You can also precede the second argument with
  3998.              a plus sign [+]; when you do, it is added to the first value
  3999.              to determine the largest file size to include in the search.
  4000.              For example,  /[s10k,+1k] select files from 10,000 through
  4001.              11,000 bytes in size.
  4002.  
  4003.              Some further examples of size ranges:
  4004.  
  4005.                   Specification       Selects Files
  4006.  
  4007.                   /[s0,0]             of length zero (empty)
  4008.                   /[s1M]              1 megabyte or more in length
  4009.                   /[s10k,+200]        between 10,000 and 10,200 bytes
  4010.  
  4011.  
  4012.              Date Ranges
  4013.  
  4014.              Date ranges select files that were created or last modified at
  4015.              any time between the two dates.  For example,
  4016.              /[d12-1-93,12-5-93] selects files that were last modified
  4017.              between December 1, 1993, and December 5, 1993.
  4018.  
  4019.              The time for the starting date defaults to 00:00:00 and the
  4020.              time for the ending date defaults to 23:59:59.  You can alter
  4021.              these defaults, if you wish, by including a start and stop
  4022.              time inside the date range.  The time is separated from the
  4023.              date with an at sign [@].  For example, the range
  4024.              /[d7-1-94@8:00a,7-3-94@6:00p] selects files that were modified
  4025.              at any time between 8:00 am on July 1, 1994 and 6:00 pm on
  4026.              July 3, 1994.  If you prefer, you can specify the times in 24-
  4027.              hour format (e.g., @18:00 for the end time in the previous
  4028.              example).
  4029.  
  4030.         -------------------------------------------------------------------
  4031.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 63
  4032.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  4033.         -------------------------------------------------------------------
  4034.  
  4035.  
  4036.              If you omit the second argument in a date range, the command
  4037.              processor substitutes the current date and time.  For example,
  4038.              /[d10-1-93] selects files dated between October 1, 1993 and
  4039.              today.
  4040.  
  4041.              You can use an offset value for either the beginning or ending
  4042.              date, or both.  An offset begins with a plus sign [+] or a
  4043.              minus sign [-] followed by an integer.  If you use an offset
  4044.              for the second value, it is calculated relative to the first.
  4045.              If you use an offset for the first (or only) value, the
  4046.              current date is used as the basis for calculation.  For
  4047.              example:
  4048.  
  4049.                   Specification       Selects Files
  4050.  
  4051.                   /[d10-27-93,+3]     modified between 10-27-93 and
  4052.                                       10-30-93
  4053.  
  4054.                   /[d10-27-93,-3]     modified between 10-24-93 and
  4055.                                       10-27-93
  4056.  
  4057.                   /[d-0]              modified today (from today minus zero
  4058.                                       days, to today)
  4059.  
  4060.                   /[d-1]              modified yesterday or today (from
  4061.                                       today minus one day, to today)
  4062.  
  4063.                   /[d-1,+0]           modified yesterday (from today minus
  4064.                                       one day, to zero days after that)
  4065.  
  4066.              You cannot use offsets in the time portion of a date range
  4067.              (the part after an at sign), but you can combine a time with a
  4068.              date offset.  For example, /[d12-8-93@12:00,+2@12:00] selects
  4069.              files that were last modified between noon on December 8 and
  4070.              noon on December 10, 1993.  Similarly, /[d-2@15:00,+1] selects
  4071.              files last modified between 3:00 pm the day before yesterday
  4072.              and the end of the day one day after that, i.e., yesterday.
  4073.              The second time defaults to the end of the day because no time
  4074.              is given.
  4075.  
  4076.  
  4077.              Time Ranges
  4078.  
  4079.              A time range specifies a file modification time without
  4080.              reference to the date.  For example, to select files modified
  4081.              between noon and 2:00 pm on any date, use /[t12:00p,2:00p].
  4082.              The times in a time range can either be in 12-hour format,
  4083.              with a trailing "a" for AM or "p" for PM, or in 24-hour
  4084.              format.
  4085.  
  4086.  
  4087.         -------------------------------------------------------------------
  4088.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 64
  4089.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  4090.         -------------------------------------------------------------------
  4091.  
  4092.  
  4093.              If you omit the second argument in a time range, you will
  4094.              select files that were modified between the first time and the
  4095.              current time, on any date.  You can also use offsets,
  4096.              beginning with a plus sign [+] or a minus sign [-] for either
  4097.              or both of the arguments in a time range.  The offset values
  4098.              are interpreted as minutes.  Some examples:
  4099.  
  4100.                   Specification       Selects Files
  4101.  
  4102.                   /[t12:00p,+120]     modified between noon and 2:00 PM on
  4103.                                       any date
  4104.                   /[t-120,+120]       modified between two hours ago and
  4105.                                       the current time on any date
  4106.                   /[t0:00,11:59]      modified in the morning on any date
  4107.  
  4108.  
  4109.              Using Ranges
  4110.  
  4111.              If you combine two types of ranges, a file must satisfy both
  4112.              ranges to be included.  For example, /[d2-8-94,2-9-94]
  4113.              /[s1024,2048] means files last modified between February 8 and
  4114.              February 9, 1994, which are also between 1,024 and 2,048 bytes
  4115.              long.
  4116.  
  4117.              When you use a date, time, or size range in a command, it
  4118.              should immediately follow the command name.  Unlike some
  4119.              command switches which apply to only part of the command line,
  4120.              the range usually applies to all file names specified for the
  4121.              command.  Any exceptions are noted in the descriptions of
  4122.              individual commands.
  4123.  
  4124.              For example, to get a directory of all the *.C files dated
  4125.              October 1, 1993, you could use this command:
  4126.  
  4127.                   c:\> dir /[d10-1-93,+0] *.c
  4128.  
  4129.              To delete all of the 0-byte files on your hard disk, you could
  4130.              use this command:
  4131.  
  4132.                   c:\> del /[s0,0] *.* /s
  4133.  
  4134.              And to copy all of the non-zero byte files that you changed
  4135.              yesterday or today to your floppy disk, you can use this
  4136.              command:
  4137.  
  4138.                   c:\> copy /[d-1] /[s1] *.* a:
  4139.  
  4140.              Date, time, and size ranges can be used with the ATTRIB, COPY,
  4141.              DEL, DESCRIBE, DIR, EXCEPT, FOR, LIST, MOVE, RD, REN, SELECT,
  4142.  
  4143.  
  4144.         -------------------------------------------------------------------
  4145.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 65
  4146.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  4147.         -------------------------------------------------------------------
  4148.  
  4149.  
  4150.              and TYPE commands.  They cannot be used with filename
  4151.              completion or in filename arguments for variable functions.
  4152.  
  4153.          ##  It can be complex to type all of the elements of a range,
  4154.              especially when it involves multiple dates and times.  In this
  4155.              case you may find it easier to use aliases for common
  4156.              operations.  For example, if you often wish to select from
  4157.              .DAT files modified over the last three days and copy the
  4158.              selected files to the floppy disk, you might define an alias
  4159.              like this:
  4160.  
  4161.                   alias workback `select /[d-2] copy (*.dat) a:`
  4162.  
  4163.              For more complex requirements, you may want to use internal
  4164.              variables (e.g. _DATE or _TIME, see page 100) and variable
  4165.              functions (e.g. @DATE, @TIME, @MAKEDATE, @MAKETIME, @FILEDATE,
  4166.              @FILETIME, or @EVAL, see page 108).  These variables and
  4167.              functions allow you to perform arithmetic and date / time
  4168.              calculations.
  4169.  
  4170.     4OS2,    The HPFS and NTFS file systems maintain 3 sets of dates and
  4171.     4NT      times for each file: creation, last access, and last
  4172.              modification.  By default, date and time ranges work with the
  4173.              last modification time stamp.  You can use the "last access"
  4174.              (a) or "created" (c) time stamp in a date or time range with
  4175.              the syntax:
  4176.  
  4177.                   /[da...]  or  /[dc...]  or .. /[ta...]  or  /[tc...]
  4178.  
  4179.              For example, to select files that were last accessed yesterday
  4180.              or today:
  4181.  
  4182.                   /[da-1]
  4183.  
  4184.  
  4185.              Multiple Filenames
  4186.  
  4187.              Most file processing commands can work with multiple files at
  4188.              one time.  To use multiple file names, you simply list the
  4189.              files one after another on the command line, separated by
  4190.              spaces.  You can use wildcards in any or all of the filenames.
  4191.              For example, to copy all .TXT and .DOC files from the current
  4192.              directory to drive A, you could use this command:
  4193.  
  4194.                   c:\> copy *.txt *.doc a:
  4195.  
  4196.              If the files you want to work with are not in the default
  4197.              directory, you must include the full path with each filename:
  4198.  
  4199.                   c:\> copy a:\details\file1.txt a:\details\file1.doc c:
  4200.  
  4201.         -------------------------------------------------------------------
  4202.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 66
  4203.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  4204.         -------------------------------------------------------------------
  4205.  
  4206.  
  4207.              Multiple filenames are handy when you want to match a group of
  4208.              files which cannot be defined with a single filename and
  4209.              wildcards.  They let you be very specific about which files
  4210.              you want to work with in a command.
  4211.  
  4212.          !   When you use multiple filenames with a command that expects
  4213.              both a source and a destination, like COPY or MOVE, be sure
  4214.              that you always include a specific destination on the command
  4215.              line.  If you don't, the command will assume that the last
  4216.              filename is the destination and may overwrite important files.
  4217.  
  4218.              Like extended wildcards and include lists (see below), the
  4219.              multiple filename feature will work with internal commands but
  4220.              not with external programs, unless those programs have been
  4221.              written to handle multiple file names on the command line.
  4222.  
  4223.              If you have a list of files to process that's too long to put
  4224.              on the command line or too time-consuming to type, see the
  4225.              SELECT command on page 313 for another way of passing multiple
  4226.              file names to a command.
  4227.  
  4228.  
  4229.              Include Lists
  4230.  
  4231.              Any internal command that accepts multiple filenames will also
  4232.              accept one or more include lists.  An include list is simply a
  4233.              group of filenames, with or without wildcards, separated by
  4234.              semicolons [;].  All files in the include list must be in the
  4235.              same directory.  You may not add a space on either side of the
  4236.              semicolon.
  4237.  
  4238.              If you used an include list instead of multiple file names for
  4239.              the previous examples, they would look like this:
  4240.  
  4241.                   c:\> copy *.txt;*.doc a:
  4242.                   c:\> copy a:\details\file1.txt;file1.doc c:
  4243.  
  4244.              Include lists are similar to multiple filenames, but have
  4245.              three important differences.  First, you don't have to repeat
  4246.              the path to your files if you use an include list, because all
  4247.              of the included files must be in the same directory.  Second,
  4248.              if you use include lists, you aren't as likely to accidentally
  4249.              overwrite files if you forget a destination path for commands
  4250.              like COPY, because the last name in the list will be part of
  4251.              the include list, and won't be seen as the destination file
  4252.              name.  (Include lists can only be used as the source parameter
  4253.              - the location files are coming from - for COPY and other
  4254.              similar commands.  They cannot be used to specify a
  4255.              destination for files.)
  4256.  
  4257.  
  4258.         -------------------------------------------------------------------
  4259.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 67
  4260.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  4261.         -------------------------------------------------------------------
  4262.  
  4263.  
  4264.              Third, multiple filenames and include lists are processed
  4265.              differently by the DIR and SELECT commands.  If you use
  4266.              multiple filenames, all of the files matching the first
  4267.              filename are processed, then all of the files matching the
  4268.              second name, and so on.  When you use an include list, all
  4269.              files that match any entry in the include list are processed
  4270.              together, and will appear together in the directory display or
  4271.              SELECT list.  You can see this difference clearly if you
  4272.              experiment with both techniques and the DIR command.  For
  4273.              example,
  4274.  
  4275.                   c:\> dir *.txt *.doc
  4276.  
  4277.              will list all the .TXT files with a directory header, the file
  4278.              list, and a summary of the total number of files and bytes
  4279.              used.  Then it will do the same for the .DOC files.  However,
  4280.  
  4281.                   c:\> dir *.txt;*.doc
  4282.  
  4283.              will display all the files in one list.
  4284.  
  4285.              Like extended wildcards and multiple filenames (see above),
  4286.              the include list feature will work with internal commands, but
  4287.              not with external programs (unless they have been programmed
  4288.              especially to support it).
  4289.  
  4290.  
  4291.              Executable Extensions
  4292.  
  4293.              Normally, when you type a filename (as opposed to an alias or
  4294.              internal command name) as the first word on the command line,
  4295.              the command processor looks for a file with that name to
  4296.              execute.  The file's extension may be .EXE or .COM to indicate
  4297.              that it contains a program, or it may have a batch file
  4298.              extension like .BTM (under OS/2, a file's contents may also
  4299.              indicate that it is executable).
  4300.  
  4301.              The exact list of default extensions for executable files
  4302.              varies slightly depending on which operating system you use,
  4303.              because each has its own rules for batch file extensions(see
  4304.                   20             page    for details).
  4305.  
  4306.              You can add to this default list of extensions, and have 4DOS,
  4307.              4OS2, or 4DOS/NT take the action you want with files that are
  4308.              not executable programs or batch files.  The action taken is
  4309.              always based on the file's extension.  For example, you could
  4310.              start your text editor whenever you type the name of a .DOC
  4311.              file, or start your database manager whenever you type the
  4312.              name of a .DAT file.
  4313.  
  4314.  
  4315.         -------------------------------------------------------------------
  4316.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 68
  4317.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  4318.         -------------------------------------------------------------------
  4319.  
  4320.  
  4321.              Environment variables define the internal command, external
  4322.              program, batch file, or alias to run for each defined file
  4323.              extension.  To create an executable extension, use the SET
  4324.              command to create a new environment variable.  An environment
  4325.              variable is recognized as an executable extension if its name
  4326.              begins with a period.
  4327.  
  4328.              For example, if you want to run a word processor called EDITOR
  4329.              whenever you type the name of a file that has an extension of
  4330.              .EDT, you could use this command:
  4331.  
  4332.                   c:\> set .edt=c:\edit\editor.exe
  4333.  
  4334.              The syntax for creating an executable extension is:
  4335.  
  4336.                   set .ext=command [options]
  4337.  
  4338.              where .EXT is the executable file extension; command is the
  4339.              name of the internal command, external program, alias, or
  4340.              batch file to run; and [options] are any command-line startup
  4341.              options you want to specify for the program, batch file, or
  4342.              alias.
  4343.  
  4344.              If the command is a batch file or external program, the
  4345.              command processor will search the PATH for it if necessary.
  4346.              However, you can make sure that the correct program or batch
  4347.              file is used, and speed up the executable extension, by
  4348.              specifying the full name including drive, path, filename, and
  4349.              extension.
  4350.  
  4351.              Once an executable extension is defined, any time you name a
  4352.              file with that extension the corresponding program, batch
  4353.              file, or alias is started, with the name of your file passed
  4354.              to it as a parameter.
  4355.  
  4356.              The following example defines QBASIC.EXE as the processor for
  4357.              .BAS files:
  4358.  
  4359.                   c:\> set .bas=c:\dos\qbasic.exe /run
  4360.  
  4361.              With this definition, if you have a file named PUSHCART.BAS in
  4362.              the current directory and enter the command:
  4363.  
  4364.                   c:\> pushcart
  4365.  
  4366.              the command processor will execute the command:
  4367.  
  4368.                   c:\dos\qbasic.exe /run pushcart.bas
  4369.  
  4370.  
  4371.  
  4372.         -------------------------------------------------------------------
  4373.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 69
  4374.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  4375.         -------------------------------------------------------------------
  4376.  
  4377.  
  4378.              The next example defines B.EXE (the Brief text editor) as the
  4379.              processor for .C files:
  4380.  
  4381.                   c:\> set .c=c:\brief\b.exe -Mxyz
  4382.  
  4383.              Now, if you have a file called HELLO.C and enter the command
  4384.  
  4385.                   c:\> hello -i30
  4386.  
  4387.              This will be expanded to:
  4388.  
  4389.                   c:\brief\b.exe -Mxyz hello.c -i30
  4390.  
  4391.              Notice that the text from the .C environment variable is
  4392.              inserted at the beginning of the line, including any options,
  4393.              followed by the original file name plus its extension, and
  4394.              then the remainder of the original command line.
  4395.  
  4396.              In order for executable extensions to work, the command,
  4397.              program, batch file, or alias must be able to interpret the
  4398.              command line properly.  For example, if a program you want to
  4399.              run doesn't accept a file name on its command line as shown in
  4400.              these examples, then executable extensions won't work with
  4401.              that program.
  4402.  
  4403.              The search for executable files starts in the current
  4404.              directory, then proceeds to each subdirectory specified by the
  4405.              PATH environment variable (if a "." is used in the PATH the
  4406.              current directory is not searched first; see the PATH command
  4407.              on page 290 for details).
  4408.  
  4409.              You may need to take this search order into account when using
  4410.              executable extensions.  Using the .BAS example above, if you
  4411.              had a file named FORMAT.BAS in the current directory and
  4412.              entered the command FORMAT A:, your command would run the
  4413.              QBASIC processor specified by the executable extension,
  4414.              instead of finding the standard DOS FORMAT command as you
  4415.              intended.  You can get around this by remembering that the DOS
  4416.              FORMAT command is in the file FORMAT.COM.  If you entered the
  4417.              command FORMAT.COM A: then the .BAS executable extension would
  4418.              not match, and the search would continue until it found the
  4419.              FORMAT.COM file.
  4420.  
  4421.          ##  Executable extensions may include wildcards, so you could, for
  4422.              example, run your text editor for any file with an extension
  4423.              beginning with T by defining an executable extension called
  4424.              .T*.  Extended wildcards (e.g., DO[CT] for .DOC and .DOT
  4425.              files) may also be used.
  4426.  
  4427.  
  4428.  
  4429.         -------------------------------------------------------------------
  4430.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 70
  4431.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  4432.         -------------------------------------------------------------------
  4433.  
  4434.  
  4435.          ##  Advanced Features
  4436.  
  4437.              The next three features are designed for advanced users.  If
  4438.              you are a novice user, you might want to skim over this
  4439.              section and return to it as your computing skills and needs
  4440.              progress.
  4441.  
  4442.  
  4443.              Conditional Commands
  4444.  
  4445.              When an internal command or external program finishes, it
  4446.              returns a result called the exit code.  Conditional commands
  4447.              allow you to perform tasks based upon the previous command's
  4448.              exit code.  Many programs return a 0 if they are successful
  4449.              and a non-zero value if they encounter an error.
  4450.  
  4451.              If you separate two commands by && (AND), the second command
  4452.              will be executed only if the first returns an exit code of 0.
  4453.              For example, the following command will only erase files if
  4454.              the BACKUP operation succeeds:
  4455.  
  4456.                   c:\> backup c:\ a: && del c:\*.bak;*.lst
  4457.  
  4458.              If you separate two commands by || (OR), the second command
  4459.              will be executed only if the first returns a non-zero exit
  4460.              code.  For example, if the following BACKUP operation fails,
  4461.              then ECHO will display a message:
  4462.  
  4463.                   c:\> backup c:\ a: || echo Error in the backup!
  4464.  
  4465.              All internal commands return an exit code, but not all
  4466.              external programs do.  Conditional commands will behave
  4467.              unpredictably if you use them with external programs which do
  4468.              not return an explicit exit code.
  4469.  
  4470.  
  4471.              Command Grouping
  4472.  
  4473.              Command grouping allows you to logically group a set of
  4474.              commands together by enclosing them in parentheses.  The
  4475.              parentheses are similar in function to the BEGIN and END block
  4476.              statements in some programming languages.
  4477.  
  4478.              There are two primary uses for command grouping.  One is to
  4479.              execute multiple commands in a place where normally only a
  4480.              single command is allowed.  For example, suppose you want to
  4481.              copy then rename all the .WKQ files on drives A: and B: using
  4482.              the FOR command.  You could do it like this:
  4483.  
  4484.                   c:\> for %drv in (A B) do copy %drv:*.wkq d:\wksave\
  4485.  
  4486.         -------------------------------------------------------------------
  4487.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 71
  4488.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  4489.         -------------------------------------------------------------------
  4490.  
  4491.  
  4492.                   c:\> for %drv in (A B) do ren %drv:*.wkq *.old
  4493.  
  4494.              But with command grouping you can do the same thing in one
  4495.              command (enter this on one line):
  4496.  
  4497.                   c:\> for %drv in (A B) do (copy %drv:*.wkq d:\wksave\
  4498.                        ^ ren %drv:*.wkq *.sav)
  4499.  
  4500.              The COPY and REN commands enclosed in the parentheses appear
  4501.              to FOR as if they were a single command, so both commands are
  4502.              executed for every element of the FOR list.  (To try a command
  4503.              like this under 4OS2 or 4DOS/NT, replace the caret [^] with an
  4504.              ampersand [&].)
  4505.  
  4506.              This kind of command grouping is most useful with the EXCEPT,
  4507.              FOR, GLOBAL, and IF commands.  You cannot use command grouping
  4508.              to make SELECT execute several commands, because SELECT will
  4509.              assume that the parentheses are marking the list of files from
  4510.              which to select, and will display an error message or give
  4511.              incorrect results if you try to use parentheses for command
  4512.              grouping instead.  (You can use a SELECT command inside the
  4513.              command grouping parentheses, you just can't use command
  4514.              grouping to specify a group of commands for SELECT to
  4515.              execute.)
  4516.  
  4517.              The second common use of command grouping is to redirect input
  4518.              or output for several commands without repeatedly using the
  4519.              redirection symbols.  For example, consider the following
  4520.              batch file fragment which places some header lines (including
  4521.              today's date) and directory displays in an output file using
  4522.              redirection.  The first ECHO command creates the file using >,
  4523.              and the other commands append to the file using >>:
  4524.  
  4525.                   echo Data files %_date > filelist
  4526.                   dir *.dat >> filelist
  4527.                   echo. >> filelist
  4528.                   echo Text files %_date >> filelist
  4529.                   dir *.txt >> filelist
  4530.  
  4531.              Using command grouping, these commands can be written much
  4532.              more simply.  Enter this example on one line (use an ampersand
  4533.              [&] as the command separator if you try this under 4OS2 or
  4534.              4DOS/NT):
  4535.  
  4536.                   (echo Data files %_date ^ dir *.dat ^ echo. ^ echo Text
  4537.                   files %_date ^ dir *.txt) > filelist
  4538.  
  4539.              The redirection, which appears outside the parentheses,
  4540.              applies to all the commands within the parentheses.  Because
  4541.              the redirection is performed only once, the commands will run
  4542.  
  4543.         -------------------------------------------------------------------
  4544.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 72
  4545.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  4546.         -------------------------------------------------------------------
  4547.  
  4548.  
  4549.              slightly faster than if each command was entered separately.
  4550.              The same approach can be used for input redirection and for
  4551.              piping.
  4552.  
  4553.              You can also use command grouping in a batch file or at the
  4554.              prompt to split commands over several lines.  This last
  4555.              example is like the redirection example above, but is entered
  4556.              at the prompt.  Note the "More?" prompt after each incomplete
  4557.              line.  None of the commands are executed until the command
  4558.              group is completed with the closing parenthesis.  This example
  4559.              does not have to be entered on one line:
  4560.  
  4561.                   c:\> (echo Data files %_date
  4562.                   More? dir *.dat
  4563.                   More? echo.
  4564.                   More? echo Text files %_date
  4565.                   More? dir *.txt) > filelist
  4566.                   c:\>
  4567.  
  4568.              A group of commands in parentheses is like a long command
  4569.              line.  The total length of the group may not exceed 511
  4570.              characters in 4DOS, or 2,047 characters in 4OS2 and 4DOS/NT,
  4571.              whether the commands are entered from the prompt, an alias, or
  4572.              a batch file.  The limit includes the space required to expand
  4573.              aliases and environment variables invoked within the group.
  4574.              In addition, each line you type at the normal prompt or the
  4575.              More? prompt, and each individual command within the line,
  4576.              must meet the usual length limits:  255 characters in 4DOS, or
  4577.              1,023 characters in 4OS2 and 4DOS/NT.
  4578.  
  4579.  
  4580.              Escape Character
  4581.  
  4582.              4DOS, 4OS2, and 4DOS/NT recognize a user-definable escape
  4583.              character.  This character gives the following character a
  4584.              special meaning; it is not the same as the ASCII ESC that is
  4585.              often used in ANSI and printer control sequences.
  4586.  
  4587.              The default 4DOS escape character is Ctrl-X (ASCII 24), which
  4588.              will be displayed on your screen as an up arrow (in this ASCII
  4589.              version of our manual, <Ctrl-X> is used to represent this
  4590.              character).  The default 4OS2 and 4DOS/NT escape character is
  4591.              a caret [^].
  4592.  
  4593.              If you don't like using the default escape character, you can
  4594.              pick another character using the SETDOS /E command (see page
  4595.              324) or the EscapeChar directive in your .INI file (see page
  4596.              138).  If you plan to share aliases or batch files between
  4597.              4DOS, 4OS2, and 4DOS/NT, see page 74 for details about
  4598.  
  4599.  
  4600.         -------------------------------------------------------------------
  4601.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 73
  4602.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  4603.         -------------------------------------------------------------------
  4604.  
  4605.  
  4606.              choosing compatible escape characters for two or more
  4607.              products.
  4608.  
  4609.              Eight special characters are recognized when they are preceded
  4610.              by the escape character.  The combination of the escape
  4611.              character and one of these characters is translated to a
  4612.              single character, as shown below.  These are useful for
  4613.              redirecting codes to the printer; <Ctrl-X>e is also useful to
  4614.              generate ANSI "escape sequences" in your PROMPT, ECHO, or
  4615.              other output commands; and <Ctrl-X>r can be used in keystroke
  4616.              aliases.  The special characters which can follow the escape
  4617.              character are:
  4618.  
  4619.                   b      backspace
  4620.                   c      comma
  4621.                   e      the ASCII ESC character (ASCII 27)
  4622.                   f      form feed
  4623.                   n      line feed
  4624.                   r      carriage return
  4625.                   s      space
  4626.                   t      tab character
  4627.  
  4628.              If you follow the escape character with any other character,
  4629.              the escape character is removed and the second character is
  4630.              copied directly to the command line.  This allows you to
  4631.              suppress the normal meaning of special characters (such as ? *
  4632.              / \ | " ` > < and &).
  4633.  
  4634.              For example, to send a form feed followed by the sequence ESC
  4635.              Y to the printer, you can use this command:
  4636.  
  4637.                   c:\> echos <Ctrl-X>f<Ctrl-X>eY > prn
  4638.  
  4639.  
  4640.         4DOS, 4OS2, and 4DOS/NT Compatibility
  4641.  
  4642.              4DOS, 4OS2, and 4DOS/NT are highly compatible with each other.
  4643.              However, there are minor differences between them.  These
  4644.              differences are caused by the different requirements of each
  4645.              operating system and by our design goal of maintaining
  4646.              compatibility between each product and the default command
  4647.              processor which it replaces.
  4648.  
  4649.              We discuss the differences between our products in this manual
  4650.              as part of the description of each feature and command.  Most
  4651.              of the differences are minor:  different command line lengths,
  4652.              a few different options in some commands, and some commands
  4653.              that only make sense in one or two products.
  4654.  
  4655.  
  4656.  
  4657.         -------------------------------------------------------------------
  4658.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 74
  4659.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  4660.         -------------------------------------------------------------------
  4661.  
  4662.  
  4663.              If you use two or more of our products, or if you want to
  4664.              share aliases and batch files with users of different
  4665.              products, you need to be aware of the differences in three
  4666.              important characters:  the Command Separator (see page 47),
  4667.              the Escape Character (page 73), and the Parameter Character
  4668.              (page 81).
  4669.  
  4670.              The default values of each of these characters in each product
  4671.              is shown in the following chart:
  4672.  
  4673.                   Character           4DOS Default   4OS2 and 4NT Default
  4674.                   -----------------   ------------   --------------------
  4675.  
  4676.                   Command Separator        ^              &
  4677.                   Escape Character         <Ctrl-X>       ^
  4678.                   Parameter Character      &              $
  4679.  
  4680.              In your batch files and aliases, and even at the command line,
  4681.              you can smooth over these differences in two ways:
  4682.  
  4683.                   * Select a consistent set of characters with .INI file
  4684.                     directives (see page 126) or the SETDOS command (page
  4685.                     322).  For example, to set the 4DOS characters to
  4686.                     match 4OS2 and 4DOS/NT, use:
  4687.  
  4688.                             CommandSep = &
  4689.                             EscapeChar = ^
  4690.                             ParameterChar = $
  4691.  
  4692.                     in 4DOS.INI, or use the command:
  4693.  
  4694.                             SETDOS /C& /P$ /E<Ctrl-X>^
  4695.  
  4696.                     (Note the use of the old escape character [<Ctrl-X>]
  4697.                     before the new one [^].  This is because the new
  4698.                     escape character is also the old command separator,
  4699.                     and will be interpreted as the end of the command if
  4700.                     it does not have an escape character before it!)
  4701.  
  4702.                   * Use internal variables that contain the current
  4703.                     special character, rather than using the character
  4704.                     itself (see page 100).  For example, this command:
  4705.  
  4706.                             if "%1" == "" (echo Argument missing! ^ quit)
  4707.  
  4708.                     will only work if the command separator is a caret.
  4709.                     However, this version works regardless of the current
  4710.                     command separator:
  4711.  
  4712.                             if "%1" == "" (echo Argument missing! %+ quit)
  4713.  
  4714.         -------------------------------------------------------------------
  4715.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 75
  4716.                                   CHAPTER 3 / USING 4DOS, 4OS2, AND 4DOS/NT
  4717.         -------------------------------------------------------------------
  4718.  
  4719.  
  4720.              The following chart shows the correspondence between the
  4721.              appropriate SETDOS command options, .INI file directives, and
  4722.              internal variables:
  4723.  
  4724.                   Special            SETDOS   INI File     Internal
  4725.                   Character          Switch   Directive    Variable
  4726.                   -----------------  ------   ----------   --------
  4727.  
  4728.                   Command Separator   /C      CommandSep     %+
  4729.                   Escape Character    /E      EscapeChar     %=
  4730.                   Parameter Character /P      ParameterChar  (none)
  4731.  
  4732.  
  4733.  
  4734.  
  4735.  
  4736.  
  4737.  
  4738.  
  4739.  
  4740.  
  4741.  
  4742.  
  4743.  
  4744.  
  4745.  
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.  
  4760.  
  4761.  
  4762.  
  4763.  
  4764.  
  4765.  
  4766.  
  4767.  
  4768.  
  4769.  
  4770.  
  4771.         -------------------------------------------------------------------
  4772.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 76
  4773.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  4774.         -------------------------------------------------------------------
  4775.  
  4776.  
  4777.  
  4778.         CHAPTER 4 / ALIASES AND BATCH FILES
  4779.  
  4780.  
  4781.         This chapter introduces two of the most powerful features of 4DOS,
  4782.         4OS2, and 4DOS/NT:  aliases and batch files.  It also discusses the
  4783.         environment (a list of information available to all programs),
  4784.         along with the command processor's internal variables and variable
  4785.         functions.  The discussion of the environment, variables, and
  4786.         variable functions is included in this chapter because they are
  4787.         most often used in aliases and batch files.
  4788.  
  4789.  
  4790.         Aliases
  4791.  
  4792.              Much of the power of 4DOS, 4OS2, and 4DOS/NT comes together in
  4793.              aliases, which give you the ability to create your own
  4794.              commands.  An alias is a name that you select for a command or
  4795.              group of commands.  Simple aliases substitute a new name for
  4796.              an existing command.  More complex aliases can redefine the
  4797.              default settings of internal or external commands, operate as
  4798.              very fast in-memory batch files, and perform commands based on
  4799.              the results of other commands.
  4800.  
  4801.              This section of the manual will show you some examples of the
  4802.              power of aliases.  See the ALIAS command (page 161) for
  4803.              complete details about writing your own aliases.
  4804.  
  4805.              The simplest type of alias gives a new name to an existing
  4806.              command.  For example, you could create a command called ROOT
  4807.              to switch to the root directory this way:
  4808.  
  4809.                   c:\> alias root = cd \
  4810.  
  4811.              After the alias has been defined this way, every time you type
  4812.              the command ROOT, you will actually execute the command CD \.
  4813.  
  4814.              Aliases can also create customized versions of commands.  For
  4815.              example, the DIR command can sort a directory in various ways.
  4816.              You can create an alias called DE that means "sort the
  4817.              directory by filename extension, and pause after each page
  4818.              while displaying it" like this:
  4819.  
  4820.                   c:\> alias de = dir /oe /p
  4821.  
  4822.              Aliases can be used to execute sequences of commands as well.
  4823.              The following command creates an alias called W which saves
  4824.              the current drive and directory, changes to the WP directory
  4825.              on drive C, runs the program E:\WP60\WP.EXE, and, when the
  4826.  
  4827.  
  4828.         -------------------------------------------------------------------
  4829.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 77
  4830.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  4831.         -------------------------------------------------------------------
  4832.  
  4833.  
  4834.              program terminates, returns to the original drive and
  4835.              directory:
  4836.  
  4837.                   c:\> alias w = `pushd c:\wp ^ e:\wp60\wp.exe ^ popd`
  4838.  
  4839.              This alias is enclosed in back-quotes because it contains
  4840.              multiple commands.  You must use the back-quotes whenever an
  4841.              alias contains multiple commands, environment variables,
  4842.              parameters (see below), redirection, or piping.  See the ALIAS
  4843.              command for full details.  Also, please note that throughout
  4844.              this section we use the 4DOS command separator, a caret [^],
  4845.              to separate multiple commands.  If you are using 4OS2 or
  4846.              4DOS/NT, substitute an ampersand [&] for the caret in the
  4847.              examples.
  4848.  
  4849.              Aliases can be nested, that is, one alias can invoke another.
  4850.              For example, the alias above could also be written as:
  4851.  
  4852.                   c:\> alias wp = e:\wp60\wp.exe
  4853.                   c:\> alias w = `pushd c:\wp ^ wp ^ popd`
  4854.  
  4855.              If you enter W as a command, the command processor will
  4856.              execute the PUSHD command, detect that the next command (WP)
  4857.              is another alias, and execute the program E:\WP60\WP.EXE, and
  4858.              - when the program exits - return to the first alias, execute
  4859.              the POPD command, and return to the prompt.
  4860.  
  4861.              You can use aliases to change the default options for both
  4862.              internal commands and external commands.  Suppose that you
  4863.              always want the DEL command to prompt before it erases a file:
  4864.  
  4865.                   c:\> alias del = *del /p
  4866.  
  4867.              An asterisk [*] is used in front of the second "del" to show
  4868.              that it is the name of an internal command, not an alias.  See
  4869.              page 163 for more information about this use of the asterisk.
  4870.  
  4871.              You may have a program on your system that has the same name
  4872.              as an internal command.  Normally, if you type the command
  4873.              name, you will start the internal command rather than the
  4874.              program you desire, unless you explicitly add its full path on
  4875.              the command line.  For example, if you have a program named
  4876.              LIST.COM in the C:\UTIL directory, you could run it with the
  4877.              command C:\UTIL\LIST.COM.  However, if you simply type LIST,
  4878.              the internal LIST command will be invoked instead.  Aliases
  4879.              give you two ways to get around this problem.
  4880.  
  4881.              First, you could define an alias that runs the program in
  4882.              question, but with a different name:
  4883.  
  4884.  
  4885.         -------------------------------------------------------------------
  4886.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 78
  4887.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  4888.         -------------------------------------------------------------------
  4889.  
  4890.  
  4891.                   c:\> alias l = c:\util\list.com
  4892.  
  4893.              Another approach is to rename the internal command and use the
  4894.              original name for the external program.  The following example
  4895.              renames the LIST command as DISPLAY and then uses a second
  4896.              alias to run LIST.COM whenever you type LIST:
  4897.  
  4898.                   c:\> alias display = *list
  4899.                   c:\> alias list = c:\util\list.com
  4900.  
  4901.              You can also assign an alias to a key, so that every time you
  4902.              press the key, the command will be invoked.  You do so by
  4903.              naming the alias with an at sign [@] followed by a key name.
  4904.              After you enter this next example, you will see a 2-column
  4905.              directory with paging whenever you press Shift-F5, then Enter:
  4906.  
  4907.                   c:\> alias @Shift-F5 = *dir /2/p
  4908.  
  4909.              This alias will put the DIR command on the command line when
  4910.              you press Shift-F5, then wait for you to enter file names or
  4911.              additional switches.  You must press Enter when you are ready
  4912.              to execute the command.  You can change this alias so that it
  4913.              executes the command immediately, and does not display it on
  4914.              the command line or wait for you to type a filename.  To do
  4915.              so, use two at signs at the start of the alias name:
  4916.  
  4917.                   c:\> alias @@Shift-F5 = *dir /2/p
  4918.  
  4919.              The next example clears the screen whenever you press Alt-F1:
  4920.  
  4921.                   c:\> alias @@Alt-F1 = cls
  4922.  
  4923.              Aliases have many other capabilities as well.  This example
  4924.              creates a simple command-line calculator.  Once you have
  4925.              entered the example, you can type CALC 4*19, for example, and
  4926.              you will see the answer:
  4927.  
  4928.                   c:\> alias calc = `echo The answer is:  %@eval[%&]`
  4929.  
  4930.              Our last example in this section creates an alias called IN.
  4931.              It will temporarily change directories, run an internal or
  4932.              external command, and then return to the current directory
  4933.              when the command is finished:
  4934.  
  4935.                   c:\> alias in = `pushd %1 ^ %2& ^ popd`
  4936.  
  4937.              Now if you type
  4938.  
  4939.                   c:\> in c:\letters wp letter.txt
  4940.  
  4941.  
  4942.         -------------------------------------------------------------------
  4943.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 79
  4944.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  4945.         -------------------------------------------------------------------
  4946.  
  4947.  
  4948.              you will change to the C:\LETTERS subdirectory, execute the
  4949.              command WP LETTER.TXT and then return to the current
  4950.              directory.
  4951.  
  4952.              Your copy of 4DOS, 4OS2, or 4DOS/NT  includes a sample alias
  4953.              file called ALIASES which contains several useful aliases and
  4954.              demonstrates many alias techniques.  Also, see the ALIAS and
  4955.              UNALIAS commands on pages 161 and 350 for more information and
  4956.              examples.  See page 87 for tips about using aliases inside
  4957.              your batch files.
  4958.  
  4959.  
  4960.         Batch Files
  4961.  
  4962.              A batch file is a file that contains a list of commands to
  4963.              execute.  4DOS, 4OS2, and 4DOS/NT read and interpret each line
  4964.              as if it had been typed at the keyboard.  Like aliases, batch
  4965.              files are handy for automating computing tasks.  Unlike
  4966.              aliases, batch files can be as long as you wish.  Batch files
  4967.              take up separate disk space for each file, and can't usually
  4968.              execute quite as quickly as aliases, since they must be read
  4969.              from the disk.
  4970.  
  4971.  
  4972.              .BAT, .CMD, and .BTM Files
  4973.  
  4974.              A batch file can run in two different modes.  In the first,
  4975.              traditional mode, each line of the batch file is read and
  4976.              executed individually.  In the second mode, the entire batch
  4977.              file is read into memory at once.  The second mode can be 5 to
  4978.              10 times faster, especially if most of the commands in the
  4979.              batch file are internal commands.  However, only the first
  4980.              mode can be used for self-modifying batch files (which are
  4981.              rare), for batch files which install memory-resident utilities
  4982.              under DOS, and for batch files larger than 64K bytes.
  4983.  
  4984.              The batch file's extension determines its mode.  Files with a
  4985.              .BAT extension (in 4DOS and 4DOS/NT), or a .CMD extension (in
  4986.              4OS2 and 4DOS/NT) are run in the slower, traditional mode.
  4987.              Files with a .BTM extension are run in the faster, more
  4988.              efficient mode.  You can change the execution mode inside a
  4989.              batch file with the LOADBTM command (see page 276).
  4990.  
  4991.  
  4992.  
  4993.  
  4994.  
  4995.  
  4996.  
  4997.  
  4998.  
  4999.         -------------------------------------------------------------------
  5000.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 80
  5001.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5002.         -------------------------------------------------------------------
  5003.  
  5004.  
  5005.              Echoing
  5006.  
  5007.              By default, each line in a batch file is displayed or "echoed"
  5008.              as it is executed.  You can change this behavior, if you want,
  5009.              in several different ways:
  5010.  
  5011.                   Any batch file line that begins with an [@] symbol will
  5012.                   not be displayed.
  5013.  
  5014.                   The display can be turned off and on within a batch file
  5015.                   with the ECHO OFF and ECHO ON commands.
  5016.  
  5017.                   The default setting can be changed with the SETDOS /V
  5018.                   command (see page 326) or the BatchEcho directive in the
  5019.                   .INI file (see page 137).
  5020.  
  5021.              For example, the following line turns off echoing inside a
  5022.              batch file.  The [@] symbol keeps the batch file from
  5023.              displaying the ECHO OFF command:
  5024.  
  5025.                   @echo off
  5026.  
  5027.              Your command processor also has a command line echo that is
  5028.              unrelated to the batch file echo setting.  See the ECHO
  5029.              command on page 223 for details about both settings.
  5030.  
  5031.  
  5032.              Batch File Parameters
  5033.  
  5034.              Like aliases and application programs, batch files can examine
  5035.              the command line that is used to invoke them.  The command
  5036.              tail (everything on the command line after the batch file
  5037.              name) is separated into individual parameters (also called
  5038.              arguments or batch variables) by scanning for the spaces,
  5039.              tabs, and commas that separate the parameters.  A batch file
  5040.              can work with the individual parameters or with the command
  5041.              tail as a whole.
  5042.  
  5043.              These parameters are numbered from %1 to %127.  %1 refers to
  5044.              the first parameter on the command line, %2 to the second, and
  5045.              so on.  It is up to the batch file to determine the meaning of
  5046.              each parameter.  You can use quotation marks to pass spaces,
  5047.              tabs, commas, and other special characters in a batch file
  5048.              parameter; see page 123 for details.
  5049.  
  5050.              Parameters that are referred to in a batch file, but which are
  5051.              missing on the command line, appear as empty strings inside
  5052.              the batch file.  For example, if you start a batch file and
  5053.              put two parameters on the command line, any reference in the
  5054.  
  5055.  
  5056.         -------------------------------------------------------------------
  5057.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 81
  5058.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5059.         -------------------------------------------------------------------
  5060.  
  5061.  
  5062.              batch file to %3, or any higher-numbered parameter, will be
  5063.              interpreted as an empty string.
  5064.  
  5065.              A batch file can also work with three special parameters:  %0
  5066.              contains the name of the batch file as it was entered on the
  5067.              command line, %# contains the number of command line
  5068.              arguments, and in 4DOS %n& contains the complete command-line
  5069.              tail starting with argument number "n" (for example, %3& means
  5070.              the third parameter and all those after it).  The default
  5071.              value of "n" is 1, so %& contains the entire command tail.
  5072.              The values of these special parameters will change if you use
  5073.              the SHIFT command (see page 330).
  5074.  
  5075.     4OS2,    By default, 4OS2 and 4DOS/NT use a dollar sign [$] instead of
  5076.     4NT      an ampersand [&] to indicate the remainder of the command
  5077.              tail.  For example, %$ means all the parameters, and %2$ means
  5078.              the second parameter and all those after it.  If you want to
  5079.              share batch files or aliases between 4DOS and these command
  5080.              processors, you can select a new character for any product
  5081.              with the SETDOS /P command (see page 325) or the ParameterChar
  5082.              directive in your .INI file (see page 140).
  5083.  
  5084.              For example, if your batch file interprets the first argument
  5085.              as a subdirectory name then the following line would move to
  5086.              the specified directory:
  5087.  
  5088.                   cd %1
  5089.  
  5090.              A friendlier batch file would check to make sure the directory
  5091.              exists and take some special action if it doesn't:
  5092.  
  5093.                   iff isdir %1 then ^ cd %1
  5094.                   else ^ echo Subdirectory %1 does not exist! ^ quit
  5095.                   endiff
  5096.  
  5097.              (see the IF and IFF commands on pages 251 and 257).
  5098.  
  5099.          ##  Batch files can also use environment variables, internal
  5100.              variables, and variable functions.  See pages 100 - 121 for a
  5101.              complete list of the internal variables and variable functions
  5102.              available.  You can use these variables and functions to
  5103.              determine system status (e.g., the type of CPU in the system),
  5104.              resource levels (e.g., the amount of free disk space), file
  5105.              information (e.g., the date and time a file was last
  5106.              modified), and other information (e.g., the current date and
  5107.              time).  You can also perform arithmetic operations (including
  5108.              date and time arithmetic), manipulate strings and substrings,
  5109.              extract parts of a filename, and perform simple file access.
  5110.  
  5111.  
  5112.  
  5113.         -------------------------------------------------------------------
  5114.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 82
  5115.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5116.         -------------------------------------------------------------------
  5117.  
  5118.  
  5119.          ##  To create temporary variables for use inside a batch file,
  5120.              just use the SET command to store the information you want in
  5121.              an environment variable.  Pick a variable name that isn't
  5122.              likely to be in use by some other program (for example, PATH
  5123.              would be a bad choice), and use the UNSET command (page 351)
  5124.              to remove these variables from the environment at the end of
  5125.              your batch file.  You can use SETLOCAL (page 329) and ENDLOCAL
  5126.              (page 226) to create a "local" environment so that the
  5127.              original environment will be restored when your batch file is
  5128.              finished.
  5129.  
  5130.          ##  Environment variables used in a batch file may contain either
  5131.              numbers or text.  It is up to you to keep track of what's in
  5132.              each variable and use it appropriately; if you don't (for
  5133.              example, if you use %@EVAL to add a number to a text string),
  5134.              you'll get an error message.
  5135.  
  5136.  
  5137.              Batch File Commands
  5138.  
  5139.              Several 4DOS, 4OS2, and 4DOS/NT commands are particularly
  5140.              suited to batch file processing.  Each command is explained in
  5141.              detail in the Command Reference section of this manual,
  5142.              beginning on page 153.  Here is a list of some of the commands
  5143.              you might find most useful:
  5144.  
  5145.                   BEEP produces a sound of any pitch and duration through
  5146.                   the computer's speaker.
  5147.  
  5148.                   CALL executes one batch file from within another.
  5149.  
  5150.                   CANCEL terminates all batch file processing.
  5151.  
  5152.                   CLS and COLOR set the screen display colors.
  5153.  
  5154.                   DO starts a loop.  The loop can be based on a counter, or
  5155.                   on a conditional test like those used in IF and IFF.
  5156.  
  5157.                   DRAWBOX draws a box on the screen.
  5158.  
  5159.                   DRAWHLINE and DRAWVLINE draw horizontal and vertical
  5160.                   lines on the screen.
  5161.  
  5162.                   ECHO and ECHOS print text on the screen (the text can
  5163.                   also be redirected to a file or device).
  5164.  
  5165.                   GOSUB executes a subroutine inside a batch file.  The
  5166.                   RETURN command terminates the subroutine.
  5167.  
  5168.                   GOTO branches to a different location in the batch file.
  5169.  
  5170.         -------------------------------------------------------------------
  5171.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 83
  5172.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5173.         -------------------------------------------------------------------
  5174.  
  5175.  
  5176.                   FOR executes commands for each file that matches a set of
  5177.                   wildcards, or each entry in a list.
  5178.  
  5179.                   IF and IFF execute commands based on a test of string or
  5180.                   numeric values, program exit codes, or other conditions.
  5181.  
  5182.                   INKEY and INPUT collect keyboard input from the user and
  5183.                   store it in environment variables.
  5184.  
  5185.                   KEYSTACK places keystrokes into the 4DOS Keystack.
  5186.  
  5187.                   LOADBTM changes the batch file operating mode.
  5188.  
  5189.                   ON initializes error handling for Ctrl-C / Ctrl-Break, or
  5190.                   for program and command errors.
  5191.  
  5192.                   PAUSE displays a message and waits for the user to press
  5193.                   a key.
  5194.  
  5195.                   QUIT ends the current batch file and optionally returns
  5196.                   an exit code.
  5197.  
  5198.                   REM places a remark in a batch file.
  5199.  
  5200.                   SCREEN positions the cursor on the screen and optionally
  5201.                   prints a message at the new location.
  5202.  
  5203.                   SCRPUT displays a message in color.
  5204.  
  5205.                   SETLOCAL saves the current disk drive, default directory,
  5206.                   environment, and alias list.  ENDLOCAL restores the
  5207.                   settings that were saved.
  5208.  
  5209.                   SHIFT changes the numbering of the parameters.
  5210.  
  5211.                   START starts another session or window in certain
  5212.                   multitasking environments.
  5213.  
  5214.                   TEXT displays a block of text.  ENDTEXT ends the block.
  5215.  
  5216.                   TIMER starts or reads a stopwatch.
  5217.  
  5218.                   VSCRPUT displays a vertical message in color.
  5219.  
  5220.              These commands, along with the internal variables and variable
  5221.              functions, make the enhanced batch file language extremely
  5222.              powerful.  Your copy of 4DOS, 4OS2, or 4DOS/NT includes a
  5223.              number of sample batch files, combined in the file
  5224.              SAMPLES.BTM, that demonstrate some of the many things you can
  5225.              do with batch files.
  5226.  
  5227.         -------------------------------------------------------------------
  5228.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 84
  5229.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5230.         -------------------------------------------------------------------
  5231.  
  5232.  
  5233.              Interrupting a Batch File
  5234.  
  5235.              You can usually interrupt a batch file by pressing Ctrl-C or
  5236.              Ctrl-Break.  Whether and when these keystrokes are recognized
  5237.              will depend on whether the command processor or an application
  5238.              program is running, how the application (if any) was written,
  5239.              whether BREAK is ON or OFF under DOS (see page 177), and
  5240.              whether the ON BREAK command is in use (see page 288).
  5241.  
  5242.              If 4DOS, 4OS2, or 4DOS/NT detects a Ctrl-C or Ctrl-Break (and
  5243.              ON BREAK is not in use), it will display a prompt, for
  5244.              example:
  5245.  
  5246.                   Cancel batch job C:\CHARGE.BTM ? (Y/N/A) :
  5247.  
  5248.              Enter N to continue, Y to terminate the current batch file and
  5249.              continue with any batch file which called it, or A to end all
  5250.              batch file processing regardless of the batch file nesting
  5251.              level.  Answering Y is similar to the QUIT command (page 301);
  5252.              answering A is similar to the CANCEL command (page 180).
  5253.  
  5254.  
  5255.              Automatic Batch Files
  5256.  
  5257.              4DOS, 4OS2, and 4DOS/NT support three "automatic" batch files,
  5258.              files that run without your intervention, as long as the
  5259.              command processor can find them.
  5260.  
  5261.              Each time 4DOS, 4OS2, or 4DOS/NT starts as either a primary or
  5262.              a secondary shell, it looks for an automatic batch file called
  5263.              4START.BTM, 4START.BAT (for 4DOS), or 4START.CMD (for 4OS2 and
  5264.              4DOS/NT).  If the 4START batch file is not in the same
  5265.              directory as your command processor itself, you should use the
  5266.              4StartPath directive in your .INI file (see page 131) to
  5267.              specify its location.  4START is optional, so the command
  5268.              processor will not display an error message if it cannot find
  5269.              the file.
  5270.  
  5271.              4START is a convenient place to change the color or content of
  5272.              the prompt for each shell, LOG the start of a shell, or put
  5273.              other special startup or configuration commands.  Under 4OS2
  5274.              and 4DOS/NT, it is one way to set aliases and environment
  5275.              variables (under 4DOS, these are normally set in
  5276.              AUTOEXEC.BAT).
  5277.  
  5278.          ##  With the exception of some 4DOS initialization switches, the
  5279.              entire startup command line passed to the command processor is
  5280.              available to 4START via batch file parameters (%1, %2, etc.).
  5281.              This can be useful if you want to see the command line passed
  5282.              to a secondary shell by an application.  For example, to pause
  5283.  
  5284.         -------------------------------------------------------------------
  5285.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 85
  5286.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5287.         -------------------------------------------------------------------
  5288.  
  5289.  
  5290.              if any parameters are passed to a secondary shell you could
  5291.              include this command in 4START (enter this on one line):
  5292.  
  5293.                   if "%1" != "" .and. "%_shell" gt 0 pause Starting shell
  5294.                   %_shell with parameters [%&]
  5295.  
  5296.     4DOS     Whenever it is started as a primary shell, 4DOS runs
  5297.              AUTOEXEC.BAT immediately after 4START.  On a DOS system,
  5298.              AUTOEXEC.BAT runs each time the computer boots up.  (If
  5299.              COMMAND.COM cannot find AUTOEXEC.BAT, it asks you for the time
  5300.              and date.  4DOS skips that step and immediately displays a
  5301.              prompt.)
  5302.  
  5303.              Normally, AUTOEXEC.BAT must be in the root directory of the
  5304.              boot drive.  You can store it in a different location (and
  5305.              even give it a different name) by using the 4DOS.INI directive
  5306.              AutoExecPath (see page 131).  You can also pass parameters to
  5307.              AUTOEXEC.BAT using the AutoExecParms directive in 4DOS.INI.
  5308.  
  5309.              4OS2 and 4DOS/NT do not execute AUTOEXEC.BAT.
  5310.  
  5311.              Whenever a 4DOS, 4OS2, or 4DOS/NT shell ends, it runs a third
  5312.              automatic batch file called 4EXIT.BTM, 4EXIT.BAT (for 4DOS),
  5313.              or 4EXIT.CMD (for 4OS2 and 4DOS/NT).  This file, if you use
  5314.              it, should be in the same directory as your 4START batch file.
  5315.              Like 4START, 4EXIT is optional.  It is not necessary in most
  5316.              circumstances, but it is a convenient place to put commands to
  5317.              save information such as a history list before a shell ends,
  5318.              or LOG the end of the shell.
  5319.  
  5320.              Under 4DOS, 4START and 4EXIT should not load any memory
  5321.              resident programs (TSRs).  Otherwise, these three files can
  5322.              include any commands that could be part of any batch file or
  5323.              any commands which you could type from the command line.
  5324.  
  5325.  
  5326.           ## Detecting 4DOS, 4OS2, or 4DOS/NT
  5327.  
  5328.              From a batch file, you can determine if 4DOS, 4OS2, or 4DOS/NT
  5329.              is loaded by testing for the variable function @EVAL, with a
  5330.              test like this:
  5331.  
  5332.                   if "%@eval[2+2]" == "4" echo 4DOS is loaded!
  5333.  
  5334.              This test can never succeed in COMMAND.COM or CMD.EXE.  Other
  5335.              variable functions could be used for the same purpose.
  5336.  
  5337.  
  5338.  
  5339.  
  5340.  
  5341.         -------------------------------------------------------------------
  5342.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 86
  5343.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5344.         -------------------------------------------------------------------
  5345.  
  5346.  
  5347.           ## Using Aliases in Batch Files
  5348.  
  5349.              One way to simplify batch file programming is to use aliases
  5350.              to hide unnecessary detail inside a batch file.  For example,
  5351.              suppose you want to implement a multiple choice list in a
  5352.              batch file that will let you select among several different
  5353.              applications.  This example shows one way to do so:
  5354.  
  5355.                   alias in `pushd %1 ^ %2& ^ popd`
  5356.                   alias choice `elseiff "%userchoice"=="%1" then`
  5357.                   :dispmenu
  5358.                   screen 8 0
  5359.                   text
  5360.                        Enter your choice:
  5361.                             1. Word Processing
  5362.                             2. Spreadsheet
  5363.                             3. Communications
  5364.                   endtext
  5365.                   inkey %%userchoice
  5366.                   iff "1"=="2" then ^ rem  Always fail and go to next line
  5367.                   choice 1 ^ in d:\letters c:\wp60\wp.exe
  5368.                   choice 2 ^ in d:\finance c:\quattro\q.exe
  5369.                   choice 3 ^ in d:\comm c:\comsw\pcplus.exe
  5370.                   else
  5371.                     scrput 23 0 bri whi on red Invalid choice, try again
  5372.                     goto dispmenu
  5373.                   endiff
  5374.                   unalias in choice
  5375.  
  5376.              The first alias, IN, expects 2 or more command-line arguments.
  5377.              It uses the first as a new working directory and changes to
  5378.              that directory with a PUSHD command.  The rest of the command
  5379.              line is interpreted as another command plus possible command
  5380.              line parameters, which the alias executes.  This alias could
  5381.              be used from the command line.
  5382.  
  5383.              The second alias, CHOICE, expects one command-line argument.
  5384.              It tests whether an environment variable called userchoice has
  5385.              the same value as the command-line argument.  This alias is
  5386.              designed just for this particular batch file.  If you try to
  5387.              use CHOICE from the command line, you will see an error
  5388.              because the alias uses ELSEIFF and THEN without the necessary
  5389.              IFF and ENDIFF to define a block.  (The last line of the batch
  5390.              file "cleans up" by removing IN and CHOICE from the alias
  5391.              list.)
  5392.  
  5393.              The next 9 lines print a menu on the screen and then get a
  5394.              keystroke from the user and store the keystroke in an
  5395.              environment variable called userchoice.  Then the batch file
  5396.              tests the user's keystroke to decide what action to take.
  5397.  
  5398.         -------------------------------------------------------------------
  5399.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 87
  5400.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5401.         -------------------------------------------------------------------
  5402.  
  5403.  
  5404.              Since the CHOICE alias starts with an ELSEIFF command, there
  5405.              has to be an IFF.  But the first condition must fail in order
  5406.              to get to the ELSEIFF command in the first CHOICE alias, so
  5407.              the IFF statement starts with a condition that will always be
  5408.              false.  The three lines after the IFF are easy to follow and
  5409.              much shorter than they would be without the aliases.  If it
  5410.              had to be typed in full, the first choice line would look like
  5411.              this:
  5412.  
  5413.                   elseiff "%userchoice"=="1" then pushd d:\letters ^
  5414.                   c:\wp60\wp.exe ^ popd
  5415.  
  5416.              There's another side to aliases in batch files.  If you're
  5417.              going to distribute your batch files to others, you need to
  5418.              remember that they may have aliases defined for the commands
  5419.              you're going to use.  For example if the user has aliased CD
  5420.              to CDD and you aren't expecting this, your file may not work
  5421.              as you intended.  There are two ways to address this problem.
  5422.              First, you can use SETLOCAL, ENDLOCAL, and UNALIAS to clear
  5423.              out aliases before your batch file starts and restore them at
  5424.              the end.  For example:
  5425.  
  5426.                   setlocal
  5427.                   unalias *
  5428.                   rem Aliases cleared, set up new aliases
  5429.                   alias ...
  5430.                   rem Other batch file commands go here
  5431.                   endlocal
  5432.  
  5433.              Remember that SETLOCAL and ENDLOCAL will save and restore not
  5434.              only the aliases but also the environment and the current
  5435.              drive and directory.
  5436.  
  5437.              If this method isn't appropriate or necessary for the batch
  5438.              file you're working on, you can also use an asterisk [*]
  5439.              before the name of any command.  The asterisk means the
  5440.              command that follows it should not be interpreted as an alias.
  5441.              For example the following command redirects a list of file
  5442.              names to the file FILELIST:
  5443.  
  5444.                   dir /b > filelist
  5445.  
  5446.              However, if the user has redefined DIR with an alias this
  5447.              command may not do what you want.  To get around this just
  5448.              use:
  5449.  
  5450.                   *dir /b > filelist
  5451.  
  5452.              The same can be done for any command in your batch file.  If
  5453.              you use the asterisk, it will disable alias processing, and
  5454.  
  5455.         -------------------------------------------------------------------
  5456.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 88
  5457.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5458.         -------------------------------------------------------------------
  5459.  
  5460.  
  5461.              the rest of the command will be processed normally as an
  5462.              internal command, external command, or batch file.  Using an
  5463.              asterisk before a command will work whether or not there is
  5464.              actually an alias defined with the same name as the command.
  5465.              If there is no alias with that name, the asterisk will be
  5466.              ignored and the command will be processed as if the asterisk
  5467.              wasn't there.
  5468.  
  5469.  
  5470.           ## Debugging Batch Files
  5471.  
  5472.              There are several tricks you can use in debugging batch files.
  5473.              Probably the simplest is to turn ECHO on at the beginning of
  5474.              the file while you're testing it, or use SETDOS /V2 to force
  5475.              ECHO on even if an ECHO OFF command is used in the batch file.
  5476.              This will give you a picture of what is happening as the file
  5477.              is executed.  It will make your output look messy of course,
  5478.              so just turn it off once things are working.  You can also
  5479.              turn ECHO on at the beginning of a group of commands you want
  5480.              to "watch", and off at the end, just by adding ECHO commands
  5481.              at the appropriate spots in your file.
  5482.  
  5483.              If an error occurs in a batch file, the error message will
  5484.              display the name of the file, the number of the line that
  5485.              contained the error, and the error itself.  For example,
  5486.  
  5487.                   e:\test.bat [3] Invalid parameter "/d"
  5488.  
  5489.              tells you that the file E:\TEST.BAT contains an error on line
  5490.              3.  The first line of the batch file is numbered 1.
  5491.  
  5492.              You can also use the SETDOS /Y1 command to single step through
  5493.              all or part of a batch file (see page 328).  Insert the
  5494.              command at the beginning of the portion of the batch file that
  5495.              you wish to single-step through, and add a SETDOS /Y0 command
  5496.              at the end of the section.  After 4DOS, 4OS2, or 4DOS/NT
  5497.              executes the SETDOS command, it will display each command
  5498.              before it is executed, followed by a Y/N/R prompt.  Press Y to
  5499.              execute the command, N to skip the command and go on to the
  5500.              next, or R or Esc to execute the remainder of the batch file
  5501.              up to the next SETDOS /Y1 command without further prompting.
  5502.              You can also press Ctrl-C or Ctrl-Break at the Y/N/R prompt to
  5503.              halt execution of the remainder of the batch file and return
  5504.              to the command processor prompt.
  5505.  
  5506.              Another trick is to insert PAUSE commands wherever you need
  5507.              them in order to be able to watch what's happening.  For
  5508.              complex debugging, you can make an alias that uses INKEY for a
  5509.              similar purpose, but helps you out a little more.  For example
  5510.  
  5511.  
  5512.         -------------------------------------------------------------------
  5513.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 89
  5514.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5515.         -------------------------------------------------------------------
  5516.  
  5517.  
  5518.              (enter this on one line, and use an ampersand [&] as the
  5519.              command separator if you are using 4OS2 or 4DOS/NT):
  5520.  
  5521.                   alias step `set skey=^ inkey Step:  %%skey ^ iff
  5522.                   "%skey"=="S" then ^ set /P ^ elseiff "%skey"=="X"
  5523.                   then ^ quit ^ endiff`
  5524.  
  5525.              Now anywhere you insert a STEP command in your file you'll get
  5526.              the Step: prompt during execution.  At that point you can type
  5527.              S to do a SET /P and display the current contents of your
  5528.              environment variables, X to exit the batch file, and any other
  5529.              key to go on.  (Of course you may need to modify this alias to
  5530.              fit your particular needs.)
  5531.  
  5532.              If you can't figure out how your aliases and variables are
  5533.              expanded, try turning LOG on at the start of the batch file.
  5534.              LOG keeps track of all commands after alias and variable
  5535.              expansion are completed, and gives you a record in a file that
  5536.              you can examine after the batch file is done.  If you simply
  5537.              want to see a record of what commands are executed, without
  5538.              the expansion, use LOG /H.
  5539.  
  5540.              You may also want to consider using redirection to capture
  5541.              your batch file output.  Simply type the batch file name
  5542.              followed by the redirection symbols, for example:
  5543.  
  5544.                   c:\> mybatch >& testout
  5545.  
  5546.              This records all batch file output, including error messages,
  5547.              in the file TESTOUT, so you can go back and examine it.  If
  5548.              you have ECHO ON in the batch file you'll get the batch
  5549.              commands intermingled with the output, which can provide a
  5550.              very useful trace of what's happening.  Of course, output from
  5551.              full-screen commands and programs that don't write to the
  5552.              standard output devices can't be recorded, but you can still
  5553.              gain a lot of useful information if your batch file does much
  5554.              output.
  5555.  
  5556.              If you're using redirection to see the output, remember that
  5557.              any prompts for input will probably go to the output file and
  5558.              not to the screen, so you need to know in advance the sequence
  5559.              of keystrokes required to get through the entire batch file,
  5560.              and enter them by hand or with KEYSTACK.  (As an example, the
  5561.              raw text for the Guided Tour distributed with new copies of
  5562.              4DOS, 4OS2, and 4DOS/NT was created by writing a 4DOS batch
  5563.              file containing the demonstration commands, testing it to get
  5564.              the proper keystroke sequence, and executing a command which
  5565.              used KEYSTACK to send the keystrokes and redirected the batch
  5566.              file's output to a disk file.)
  5567.  
  5568.  
  5569.         -------------------------------------------------------------------
  5570.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 90
  5571.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5572.         -------------------------------------------------------------------
  5573.  
  5574.  
  5575.           ## Batch File String Processing
  5576.  
  5577.              As you gain experience with batch files, you're likely to find
  5578.              that you need to manipulate text strings.  You may need to
  5579.              prompt a user for a name or password, process a list of files,
  5580.              or find a name in a phone list.  All of these are examples of
  5581.              string processing - the manipulation of lines of readable
  5582.              text.
  5583.  
  5584.              4DOS, 4OS2, and 4DOS/NT include several features that make
  5585.              string processing easier.  For example, you can use the INKEY
  5586.              and INPUT commands for user input; the ECHO, SCREEN, SCRPUT,
  5587.              and VSCRPUT commands for output; and the FOR command or the
  5588.              @FILEREAD function to scan through the lines of a file.  In
  5589.              addition, variable functions offer a wide range of string
  5590.              handling capabilities (see page 108 for full details).
  5591.  
  5592.              For example, suppose you need a batch file that will prompt a
  5593.              user for a name, break the name into a first name and a last
  5594.              name, and then run a hypothetical LOGIN program.  LOGIN
  5595.              expects the syntax /F:first /L:last with both the first and
  5596.              last names in upper case and neither name longer than 8
  5597.              characters.  Here is one way to write such a program:
  5598.  
  5599.                   @echo off
  5600.                   setlocal
  5601.                   unalias *
  5602.                   input Enter your name (no initials):  %%name
  5603.  
  5604.                   set first=%@word[%name,0]
  5605.                   set flen=%@len[%first]
  5606.                   set last=%@word[%name,1]
  5607.                   set llen=%@len[%last]
  5608.  
  5609.                   iff %flen gt 8 .or. %llen gt 8
  5610.                      echo First or last name too long
  5611.                      quit
  5612.                   endiff
  5613.  
  5614.                   login /F:%@upper[%first] /L:%@upper[%last]
  5615.                   endlocal
  5616.  
  5617.              The SETLOCAL command at the beginning of this batch file saves
  5618.              the environment and aliases.  Then the UNALIAS * command
  5619.              removes any existing aliases so they won't interfere with the
  5620.              behavior of the commands in the remainder of the batch file
  5621.              (you can accomplish the same thing by using an asterisk [*] in
  5622.              front of each command).  The first block of lines ends with an
  5623.              INPUT command which asks the user to enter a name.  The user's
  5624.              input is stored in the environment variable NAME.
  5625.  
  5626.         -------------------------------------------------------------------
  5627.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 91
  5628.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5629.         -------------------------------------------------------------------
  5630.  
  5631.  
  5632.              The second block of lines extracts the user's first and last
  5633.              names from the NAME variable and calculates the length of
  5634.              each.  It stores the first and last name, along with the
  5635.              length of each, in additional environment variables.  Note
  5636.              that the @WORD function numbers the first word as 0, not as 1.
  5637.  
  5638.              The IFF command in the third block of lines tests the length
  5639.              of both the first and last names.  If either is longer than 8
  5640.              characters, the batch file displays an error message and ends.
  5641.              Finally, in the last block, the batch file executes the LOGIN
  5642.              program with the appropriate parameters, then uses the
  5643.              ENDLOCAL command to restore the original environment and alias
  5644.              list.  At the same time, ENDLOCAL discards the temporary
  5645.              variables that the batch file used (NAME, FIRST, FLEN, etc.).
  5646.  
  5647.              When you're processing strings, you also need to avoid some
  5648.              common traps.  The biggest one is handling special characters.
  5649.  
  5650.              Suppose you have a batch file with these two commands, which
  5651.              simply accept a string and display it:
  5652.  
  5653.                   input Enter a string:  %%str
  5654.                   echo %str
  5655.  
  5656.              Those lines look safe, but what happens if the user enters the
  5657.              string "some > none" (without the quotes).  After the string
  5658.              is placed in the variable STR, the second line becomes
  5659.  
  5660.                   echo some > none
  5661.  
  5662.              The ">" is a redirection symbol, so the line echoes the string
  5663.              "some" and redirects it to a file called NONE - probably not
  5664.              what you expected.  You could try using quotation marks (see
  5665.              page 123) to avoid this kind of problem, but that won't quite
  5666.              work.  If you use back-quotes (ECHO `%STR`), the command will
  5667.              echo the four-character string %STR.  Environment variable
  5668.              names are not expanded (replaced by their contents, see page
  5669.              121) when they are inside back-quotes.
  5670.  
  5671.              If you use double quotes (ECHO "%STR"), the string entered by
  5672.              the user will be displayed properly, and so will the quotation
  5673.              marks.  With double quotes, the output would look like this:
  5674.  
  5675.                   "some > none"
  5676.  
  5677.              As you can imagine, this kind of problem becomes much more
  5678.              difficult if you try to process text from a file.  Special
  5679.              characters in the text can cause all kinds of confusion in
  5680.              your batch files.  Text containing back-quotes, double quotes,
  5681.  
  5682.  
  5683.         -------------------------------------------------------------------
  5684.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 92
  5685.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5686.         -------------------------------------------------------------------
  5687.  
  5688.  
  5689.              or redirection symbols can be virtually impossible to handle
  5690.              correctly.
  5691.  
  5692.              One way to overcome these potential problems is to use the
  5693.              SETDOS /X command (see page 327) to temporarily disable
  5694.              redirection symbols and other special characters.  The two-
  5695.              line batch file above would be a lot more likely to produce
  5696.              the expected results if it were rewritten this way:
  5697.  
  5698.                   setdos /x-15678
  5699.                   input Enter a string:  %%str
  5700.                   echo %str
  5701.                   setdos /x0
  5702.  
  5703.              The first line turns off alias processing and disables several
  5704.              special symbols, including the command separator and all
  5705.              redirection symbols.  Once the string has been processed, the
  5706.              last line re-enables the features that were turned off in the
  5707.              first line.
  5708.  
  5709.              If you need advanced string processing capabilities beyond
  5710.              those provided by 4DOS, 4OS2, and 4DOS/NT, you may want to
  5711.              consider using the REXX language.  Our products support
  5712.              external REXX programs for this purpose; see page 95 for
  5713.              additional details.
  5714.  
  5715.  
  5716.           ## Batch File Compression
  5717.  
  5718.              You can compress your .BTM files with a program called
  5719.              BATCOMP.EXE, which is distributed with 4DOS, 4OS2, and
  5720.              4DOS/NT.  This program condenses batch files by about a third
  5721.              and makes them unreadable with the LIST command and similar
  5722.              utilities.  Compressed batch files run at approximately the
  5723.              same speed as regular .BTM files.
  5724.  
  5725.              You may want to consider compressing batch files if you need
  5726.              to distribute them to others and keep your original code
  5727.              secret or prevent your users from altering them.  You may also
  5728.              want to consider compressing batch files to save some disk
  5729.              space on the systems where the compressed files are used.
  5730.              (However, you will not save space if you keep your compressed
  5731.              batch files on a disk compressed with a program like DBLSPACE,
  5732.              Stacker, or SuperStor.)
  5733.  
  5734.              The full syntax for the batch compression program is
  5735.  
  5736.                   BATCOMP [/O] input file [output file]
  5737.  
  5738.  
  5739.  
  5740.         -------------------------------------------------------------------
  5741.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 93
  5742.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5743.         -------------------------------------------------------------------
  5744.  
  5745.  
  5746.              You must specify the full name of the input file, including
  5747.              its extension, on the BATCOMP command line.  If you do not
  5748.              specify the output file, BATCOMP will use the same base name
  5749.              as the input file and add a .BTM extension.  BATCOMP will also
  5750.              add a .BTM extension if you specify a base name for the output
  5751.              file without an extension.  For example, to compress
  5752.              MYBATCH.BAT and save the result as MYBATCH.BTM, you can use
  5753.              any of these three commands:
  5754.  
  5755.                   c:\> batcomp mybatch.bat
  5756.                   c:\> batcomp mybatch.bat mybatch
  5757.                   c:\> batcomp mybatch.bat mybatch.btm
  5758.  
  5759.              If the output file (MYBATCH.BTM in the examples above) already
  5760.              exists, BATCOMP will prompt you before overwriting the file.
  5761.              You can disable the prompt by including /O on the BATCOMP
  5762.              command line immediately before the input file name.  Even if
  5763.              you use the /O option, BATCOMP will not compress a file into
  5764.              itself.
  5765.  
  5766.              JP Software does not provide a decompression utility to
  5767.              uncompress batch files.  If you use BATCOMP.EXE, make sure
  5768.              that you also keep a copy of the original batch file for
  5769.              future inspection or modification.
  5770.  
  5771.              You can adopt one of two strategies for keeping track of your
  5772.              original source files and compressed batch files.  First, you
  5773.              may want to create the source files with a traditional .BAT or
  5774.              .CMD extension and reserve the .BTM extension for compressed
  5775.              batch files.  The advantage of this approach is that you can
  5776.              modify and test the uncompressed versions at any time,
  5777.              although they will run in the slower, traditional mode unless
  5778.              they begin with a LOADBTM command (see page 276).
  5779.  
  5780.              If you prefer, you can use a .BTM extension for both the
  5781.              source and compressed files.  In this case you will have to
  5782.              use a different base name for each file.  For example, you
  5783.              might use MYBATCHS.BTM for the source file and MYBATCH.BTM for
  5784.              the compressed file.  This may make it more difficult to keep
  5785.              track of the correspondence between the source file and the
  5786.              compressed file, but it allows both files to run automatically
  5787.              in the high-speed .BTM mode.
  5788.  
  5789.              Each of our command processors includes its own version of
  5790.              BATCOMP.EXE, set up to run under the corresponding operating
  5791.              system. However, the output produced by each program is the
  5792.              same, so a batch file compressed with any version of BATCOMP
  5793.              can be used with any JP Software command processor.
  5794.  
  5795.  
  5796.  
  5797.         -------------------------------------------------------------------
  5798.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 94
  5799.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5800.         -------------------------------------------------------------------
  5801.  
  5802.  
  5803.              If you plan to distribute batch files to users of different
  5804.              platforms, be sure to read the compatibility discussion on
  5805.                   74             page   .
  5806.  
  5807.  
  5808.           ## REXX Support
  5809.  
  5810.              REXX is a a powerful file and text processing language
  5811.              developed by IBM, and available on many PC and other
  5812.              platforms.  You can invoke REXX programs from 4DOS, 4OS2, or
  5813.              4DOS/NT.  REXX is an ideal extension to the 4DOS, 4OS2, and
  5814.              4DOS/NT batch language, especially if you need advanced string
  5815.              processing capabilities.
  5816.  
  5817.              The REXX language is not built into 4DOS, 4OS2, or 4DOS/NT.
  5818.              Under DOS and Windows NT, you must have a copy of Personal
  5819.              REXX from Quercus Systems in Saratoga, CA in order to use the
  5820.              REXX language.  Under IBM OS/2 1.3 and above you can use the
  5821.              built-in REXX language provided by IBM, or use Quercus's
  5822.              Personal REXX for OS/2.  (Personal REXX is available from JP
  5823.              Software or directly from Quercus Systems.)
  5824.  
  5825.     4DOS     Under 4DOS, REXX programs are stored in .REX files.  To enable
  5826.              REXX support you must install Personal REXX, and define an
  5827.              executable extension (see page 68) that tells 4DOS to load
  5828.              Personal REXX when you invoke a .REX file.  For example:
  5829.  
  5830.                   set .rex=c:\prexx\rexx.exe
  5831.  
  5832.     4OS2     Under 4OS2, REXX programs are stored in .CMD files.  4OS2
  5833.              checks to see if the first two characters on the first line of
  5834.              a .CMD file are [/*], the beginning of a REXX comment.  If so,
  5835.              it passes the file to OS/2's built-in REXX facility for
  5836.              processing.  If Personal REXX for OS/2 is installed, it
  5837.              automatically replaces OS/2's built-in REXX, and handles all
  5838.              REXX commands passed by 4OS2.
  5839.  
  5840.     4NT      Under 4DOS/NT, REXX programs may be stored in .CMD or .REX
  5841.              files.  4DOS/NT checks to see if the first two characters on
  5842.              the first line of a .CMD or .REX file are [/*].  If so, it
  5843.              passes the file to Personal REXX for Windows NT for
  5844.              processing.  You must have Personal REXX for Windows NT
  5845.              installed to enable 4DOS/NT's REXX support.
  5846.  
  5847.              Both Personal REXX and OS/2's built-in REXX extend the
  5848.              interface between REXX and the command processor by allowing
  5849.              you to invoke 4DOS, 4OS2, or 4DOS/NT commands from within a
  5850.              REXX program.  For details, or for more information on any
  5851.              aspect of REXX, see your Personal REXX or OS/2 REXX
  5852.              documentation.
  5853.  
  5854.         -------------------------------------------------------------------
  5855.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 95
  5856.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5857.         -------------------------------------------------------------------
  5858.  
  5859.  
  5860.     4OS2, ## EXTPROC Support
  5861.     4NT
  5862.              4OS2 and 4DOS/NT offer an external processor (EXTPROC) option
  5863.              for batch files that lets you define an external program to
  5864.              process a particular .CMD file.  To identify a .CMD file to be
  5865.              used with an external processor, place the string "EXTPROC" as
  5866.              the first word on the first line of the file, followed by the
  5867.              name of the external program that should be called.  The
  5868.              command processor will start the program and pass it the name
  5869.              of the .CMD file and any command-line arguments that were
  5870.              entered.
  5871.  
  5872.              For example, suppose GETDATA.CMD contains the following lines:
  5873.  
  5874.                   EXTPROC D:\DATAACQ\DATALOAD.EXE
  5875.                   OPEN PORT1
  5876.                   READ 4000
  5877.                   DISKWRITE D:\DATAACQ\PORT1\RAW
  5878.  
  5879.              Then if you entered the command:
  5880.  
  5881.                   [d:\dataacq] getdata /p17
  5882.  
  5883.              The command processor would read the GETDATA.CMD file,
  5884.              determine that it began with an EXTPROC command, read the name
  5885.              of the processor program, and then execute the command:
  5886.  
  5887.                   D:\DATAACQ\DATALOAD.EXE D:\DATAACQ\GETDATA.CMD /p17
  5888.  
  5889.              The hypothetical DATALOAD.EXE program would then be
  5890.              responsible for reopening the GETDATA.CMD file, ignoring the
  5891.              EXTPROC line at the start, and interpreting the other
  5892.              instructions in the file.  It would also have to respond
  5893.              appropriately to the command-line parameter entered (/p17).
  5894.  
  5895.              Do not try to use 4OS2 or 4DOS/NT as the external processor
  5896.              named on the EXTPROC line in the .CMD file.  They will
  5897.              interpret the EXTPROC line as a command to re-open themselves.
  5898.              The result will be an infinite loop that will continue until
  5899.              the computer runs out of resources and locks up.
  5900.  
  5901.  
  5902.         Using the Environment
  5903.  
  5904.              The environment is a collection of information about your
  5905.              computer that every program receives.  Each entry in the
  5906.              environment consists of a variable name, followed by an equal
  5907.              sign and a string of text.  You can automatically substitute
  5908.              the text for the variable name in any command.  To create the
  5909.              substitution, include a percent sign [%] and a variable name
  5910.  
  5911.         -------------------------------------------------------------------
  5912.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 96
  5913.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5914.         -------------------------------------------------------------------
  5915.  
  5916.  
  5917.              on the command line or in an alias or batch file.  For
  5918.              example, you can create a variable named BACKUP like this:
  5919.  
  5920.                   c:\> set BACKUP=*.bak;*.bk!;*.bk
  5921.  
  5922.              If you then type
  5923.  
  5924.                   c:\> del %BACKUP
  5925.  
  5926.              it is equivalent to the following command:
  5927.  
  5928.                   del *.bak;*.bk!;*.bk
  5929.  
  5930.          ##  The variable names you use this way may contain any alphabetic
  5931.              or numeric characters, the underscore character [_], and the
  5932.              dollar sign [$].  You can force acceptance of other characters
  5933.              by including the full variable name in square brackets, like
  5934.              this:  %[AB##2].  You can also "nest" environment variables
  5935.              using square brackets.  For example %[%var1] means "the
  5936.              contents of the variable whose name is stored in VAR1".  A
  5937.              variable referenced with this technique cannot contain more
  5938.              than 255 characters of information.  Nested variable expansion
  5939.              can be disabled with the SETDOS /X command (see page 327).
  5940.  
  5941.              In 4DOS, the size of the environment is specified by the
  5942.              Environment and EnvFree directives in 4DOS.INI (see page 132)
  5943.              or by the /E: startup switch (see the 4DOS Introduction and
  5944.              Installation Guide).  In 4OS2 and 4DOS/NT the size of the
  5945.              environment is set automatically.
  5946.  
  5947.          ##  Environment variables may contain alias names.  The command
  5948.              processor will substitute the variable value for the name,
  5949.              then check for any alias name which may have been included
  5950.              within the variable's value.  For example, the following
  5951.              commands would generate a 2-column directory of the .TXT
  5952.              files:
  5953.  
  5954.                   c:\> alias d2 dir /2
  5955.                   c:\> set cmd=d2
  5956.                   c:\> %cmd *.txt
  5957.  
  5958.          ##  The trailing percent sign that was traditionally required for
  5959.              environment variable names is not usually required in 4DOS,
  5960.              4OS2, or 4DOS/NT, which accept any character that cannot be
  5961.              part of a variable name as the terminator.  However, the
  5962.              trailing percent can be used to maintain compatibility.
  5963.  
  5964.              The trailing percent sign is needed if you want to join two
  5965.              variable values.  The following examples show the possible
  5966.  
  5967.  
  5968.         -------------------------------------------------------------------
  5969.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 97
  5970.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  5971.         -------------------------------------------------------------------
  5972.  
  5973.  
  5974.              interactions between variables and literal strings.  First,
  5975.              create two environment variables called ONE and TWO this way:
  5976.  
  5977.                   c:\> set ONE=abcd
  5978.                   c:\> set TWO=efgh
  5979.  
  5980.              Now the following combinations produce the output text shown:
  5981.  
  5982.                   %ONE%TWO            abcdTWO   ("%ONE%" + "TWO")
  5983.                   %ONE%TWO%           abcdTWO   ("%ONE%" + "TWO%")
  5984.                   %ONE%%TWO           abcdefgh  ("%ONE%" + "%TWO")
  5985.                   %ONE%%TWO%          abcdefgh  ("%ONE%" + "%TWO%")
  5986.                   %ONE%[TWO]          abcd[TWO] ("%ONE%" + "[TWO]")
  5987.                   %ONE%[TWO]%         abcd[TWO] ("%ONE%" + "[TWO]%")
  5988.                   %[ONE]%TWO          abcdefgh  ("%[ONE]" + "%TWO")
  5989.                   %[ONE]%TWO%         abcdefgh  ("%[ONE]" + "%TWO%")
  5990.  
  5991.          ##  If you want to pass a percent sign to a command, or a string
  5992.              which includes a percent sign, you must use two percent signs
  5993.              in a row.  Otherwise, the single percent sign will be seen as
  5994.              the beginning of a variable name and will not be passed on to
  5995.              the command.  For example, to display the string "We're with
  5996.              you 100%" you would use the command:
  5997.  
  5998.                   echo We're with you 100%%
  5999.  
  6000.              You can also use back-quotes around the text, rather than a
  6001.              double percent sign.  See page 123 for details.
  6002.  
  6003.     4DOS     Each copy of the command processor maintains its own copy of
  6004.              the environment.  The copy of the environment maintained by
  6005.              the primary shell is called the master environment.  When
  6006.              using a secondary shell, 4DOS will allow you to access the
  6007.              master environment in the primary shell with the commands SET
  6008.              /M (page 319), UNSET /M (page 351), and ESET /M (page 227),
  6009.              and with the %@MASTER variable function (page 118).  Master
  6010.              environment access is not available in 4OS2 or 4DOS/NT.
  6011.  
  6012.  
  6013.              Configuration Variables
  6014.  
  6015.              The following environment variables have special meanings in
  6016.              4DOS, 4OS2, and 4DOS/NT.
  6017.  
  6018.                   CDPATH tells the command processor where to search for
  6019.                   directories specified by the CD, CDD, and PUSHD commands
  6020.                   and in automatic directory changes.  (_CDPATH can be used
  6021.                   as an alternative to CDPATH if you are using Microsoft
  6022.                   Bookshelf, which uses a CDPATH variable for its own
  6023.                   purposes.)  CDPATH is composed of a list of directories,
  6024.  
  6025.         -------------------------------------------------------------------
  6026.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 98
  6027.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6028.         -------------------------------------------------------------------
  6029.  
  6030.  
  6031.                   separated by semicolons [;].  See page 44 for more
  6032.                   information about using CDPATH.
  6033.  
  6034.                   CMDLINE is the fully expanded text of the currently
  6035.                   executing command line.  CMDLINE is set just before
  6036.                   invoking any .COM, .EXE, .BTM, .BAT, or .CMD file.  If a
  6037.                   command line is prefaced with an "@" to prevent echoing
  6038.                   (see page 38), it will not be put in CMDLINE, and any
  6039.                   previous CMDLINE variable will be removed from the
  6040.                   environment.  Under DOS, this allows you to squeeze out
  6041.                   the last few bytes of environment space before loading
  6042.                   TSRs by prefacing each TSR command with an "@".
  6043.  
  6044.                   COLORDIR controls directory display colors used by DIR
  6045.                   and SELECT.  See page 30 for a complete description of
  6046.                   the format of this variable.
  6047.  
  6048.                   COMSPEC contains the full path and name of the command
  6049.                   processor.  COMSPEC is most commonly used by applications
  6050.                   which have a "shell to the command prompt" feature.  For
  6051.                   details on how COMSPEC is set and used, see your
  6052.                   Introduction and Installation Guide.
  6053.  
  6054.                   DIRCMD  is used by some versions of COMMAND.COM and
  6055.                   CMD.EXE to hold default options for the DIR command.
  6056.                   4DOS and its cousins do not support this variable, but
  6057.                   you can achieve the same effect with an alias.  For
  6058.                   example, if you want the DIR command to default to a 2-
  6059.                   column display with a vertical sort and a pause at the
  6060.                   end of each page, you could use this alias:
  6061.  
  6062.                        c:\> alias dir = `*dir /2/p/v`
  6063.  
  6064.                   If you wish to continue to use DIRCMD for compatibility
  6065.                   with systems that do not use 4DOS, you can define the
  6066.                   alias this way:
  6067.  
  6068.                        c:\> alias dir = `*dir %dircmd`
  6069.  
  6070.                   PATH is a list of directories that 4DOS, 4OS2, or 4DOS/NT
  6071.                   will search for executable files that aren't in the
  6072.                   current directory.  PATH may also be used by some
  6073.                   application programs to find their own files.  See page
  6074.                   20 and the PATH command on page 290 for a full
  6075.                   description of this variable.
  6076.  
  6077.                   PROMPT defines the command-line prompt.  It can be set or
  6078.                   changed with the PROMPT command (see page 295).
  6079.  
  6080.  
  6081.  
  6082.         -------------------------------------------------------------------
  6083.         Copr. 1994, JP Software Inc.     4DOS, 4OS2, 4DOS/NT Reference / 99
  6084.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6085.         -------------------------------------------------------------------
  6086.  
  6087.  
  6088.     4DOS          TEMP specifies the directory where 4DOS should store
  6089.                   temporary pipe files if the TEMP4DOS variable doesn't
  6090.                   exist.  Some other programs also use TEMP to define where
  6091.                   they should place their temporary files.  Temporary pipe
  6092.                   files are not used in 4OS2 and 4DOS/NT.
  6093.  
  6094.     4DOS          TEMP4DOS specifies where 4DOS should store temporary pipe
  6095.                   files.  Temporary pipe files are not used in 4OS2 and
  6096.                   4DOS/NT.
  6097.  
  6098.     4NT      In addition, 4DOS/NT uses the environment to keep track of the
  6099.              default directory on each drive or hard disk volume.  DOS and
  6100.              OS/2 keep track of the default directory for each drive letter
  6101.              internally; Windows NT does not.  4DOS/NT overcomes this
  6102.              incompatibility by saving the default directory for each drive
  6103.              in the environment, using variable names that cannot be
  6104.              accessed by the user.  Each variable begins with an equal sign
  6105.              followed by the drive letter and a colon (for example, =C:).
  6106.              You can view these variables with the SET command, but you
  6107.              cannot change them with any of the commands in 4DOS/NT.
  6108.  
  6109.  
  6110.           ## Internal Variables
  6111.  
  6112.              Internal variables are special environment variables built
  6113.              into 4DOS, 4OS2, and 4DOS/NT to provide information about your
  6114.              system.  They are not actually stored in the environment, but
  6115.              can be used in commands, aliases, and batch files just like
  6116.              any other environment variable.  The values of these variables
  6117.              are stored internally in the command processor, and cannot be
  6118.              changed with the SET, UNSET, or ESET command.  However, you
  6119.              can override any of these variables by defining a new variable
  6120.              with the same name.
  6121.  
  6122.              These internal variables are often used in batch files and
  6123.              aliases to examine system resources and adjust to the current
  6124.              computer settings.  You can examine the contents of any
  6125.              internal variable (except %= or %+) from the command line with
  6126.              a command like this:
  6127.  
  6128.                   c:\> echo %variablename
  6129.  
  6130.              The variables are listed below.  The first list is by
  6131.              category, to assist you in locating the information you want
  6132.              quickly.  The second list includes all the variables in
  6133.              alphabetical order, and defines the meaning of each one.
  6134.  
  6135.  
  6136.  
  6137.  
  6138.  
  6139.         -------------------------------------------------------------------
  6140.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 100
  6141.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6142.         -------------------------------------------------------------------
  6143.  
  6144.  
  6145.              Internal Variable Categories
  6146.  
  6147.              Hardware status:
  6148.  
  6149.                _APMAC         _APMBATT       _APMLIFE       _CPU
  6150.                _KBHIT         _MONITOR       _NDP           _VIDEO
  6151.  
  6152.              Operating system and software status:
  6153.  
  6154.                _ANSI          _BOOT          _CODEPAGE      _COUNTRY
  6155.                _DOS           _DOSVER        _DPMI          _DV
  6156.                _MOUSE         _WIN           _WINDIR        _WINSYSDIR
  6157.                _WINVER
  6158.  
  6159.              Command processor status:
  6160.  
  6161.                _4VER          _ALIAS         _BATCH         _BATCHLINE
  6162.                _BATCHNAME     _DNAME         _ENV           _HLOGFILE
  6163.                _KSTACK        _LOGFILE       _PID           _PIPE
  6164.                _PPID          _PTYPE         _SHELL         _SID
  6165.                _SWAPPING      _TRANSIENT     _WINTITLE
  6166.  
  6167.              Screen and color:
  6168.  
  6169.                _BG            _COLUMN        _COLUMNS       _FG
  6170.                _ROW           _ROWS
  6171.  
  6172.              Drives and directories:
  6173.  
  6174.                _CWD           _CWDS          _CWP           _CWPS
  6175.                _DISK          _LASTDISK
  6176.  
  6177.              Dates and times:
  6178.  
  6179.                _DATE          _DAY           _DOW           _DOY
  6180.                _HOUR          _MINUTE        _MONTH         _SECOND
  6181.                _TIME          _YEAR
  6182.  
  6183.              Error codes:
  6184.  
  6185.                ?              ??             _?             _SYSERR
  6186.  
  6187.              Compatibility:
  6188.  
  6189.                =              +
  6190.  
  6191.  
  6192.  
  6193.  
  6194.  
  6195.  
  6196.         -------------------------------------------------------------------
  6197.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 101
  6198.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6199.         -------------------------------------------------------------------
  6200.  
  6201.  
  6202.              Internal Variable Details
  6203.  
  6204.              (In the list below the possible values for most variables are
  6205.              shown in double quotes for ease of understanding.  The actual
  6206.              values returned by the variables do not include the double
  6207.              quotes.)
  6208.  
  6209.              ? contains the exit code of the last external command.  Many
  6210.              programs return a "0" to indicate success and a non-zero value
  6211.              to signal an error.  However, not all programs return an exit
  6212.              code.  If no explicit exit code is returned, the value of %?
  6213.              is undefined.
  6214.  
  6215.     4DOS     ?? returns a code which explains how the last program
  6216.              terminated:
  6217.  
  6218.                   0 - program terminated normally.
  6219.                   1 - program terminated by Ctrl-C or Ctrl-Break.
  6220.                   2 - program terminated due to a critical error.
  6221.                   3 - program terminated and stayed resident in memory
  6222.                          (TSR).
  6223.  
  6224.              _? contains the exit code of the last internal command.  It is
  6225.              set to "0" if the command was successful, "1" if a usage error
  6226.              occurred, "2" if another command processor error or an
  6227.              operating system error occurred, or "3" if the command was
  6228.              interrupted by Ctrl-C or Ctrl-Break.  You must use or save
  6229.              this value immediately, because it is set by every internal
  6230.              command.
  6231.  
  6232.              = returns the current escape character.  Use this variable,
  6233.              instead of the actual escape character, if you want your batch
  6234.              files and aliases to work regardless of how the escape
  6235.              character is defined.  For example, if the escape character is
  6236.              a caret [^] (the default in 4OS2 and 4DOS/NT), both of the
  6237.              commands below will send a form feed to the printer.  However,
  6238.              if the escape character has been changed,  the first command
  6239.              will send the string "^f" to the printer, while the second
  6240.              command will continue to work as intended.
  6241.  
  6242.                   echos ^f > prn
  6243.                   echos %=f > prn
  6244.  
  6245.              + returns the current command separator.  Use this variable,
  6246.              instead of the actual command separator, if you want your
  6247.              batch files and aliases to work regardless of how the command
  6248.              separator is defined.  For example, if the command separator
  6249.              is an ampersand [&] (the default in 4OS2 and 4DOS/NT), both of
  6250.              the commands below will display "Hello" on one line and
  6251.              "world" on the next.  However, if the command separator has
  6252.  
  6253.         -------------------------------------------------------------------
  6254.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 102
  6255.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6256.         -------------------------------------------------------------------
  6257.  
  6258.  
  6259.              been changed the first command will display "Hello & echo
  6260.              world", while the second command will continue to work as
  6261.              intended.
  6262.  
  6263.                   echo Hello & echo world
  6264.                   echo Hello %+ echo world
  6265.  
  6266.              _4VER is the current 4DOS, 4OS2, or 4DOS/NT version (for
  6267.              example, "5.0").
  6268.  
  6269.     4DOS     _ALIAS contains the free space in the alias list, in bytes.
  6270.  
  6271.              _ANSI contains "1" if internal flags indicate that ANSI.SYS or
  6272.              a compatible driver is installed; "0" if not.
  6273.  
  6274.     4OS2     4OS2 always enables OS/2's ANSI support, and assumes that it
  6275.              remains enabled.  Therefore _ANSI always returns "1" in 4OS2.
  6276.  
  6277.     4NT      Under 4DOS/NT, _ANSI always returns "0", because there is no
  6278.              ANSI support in Windows NT.
  6279.  
  6280.     4DOS     In 4DOS, the internal flags which determine the value of _ANSI
  6281.              depend on the SETDOS /A option (see page 323) and the ANSI
  6282.              directive in 4DOS.INI (see page 137), as shown in the table
  6283.              below.  If SETDOS /A is 0 or ANSI is set to Auto, 4DOS tests
  6284.              for the presence of an ANSI driver.  In this case you may need
  6285.              to experiment to see if this variable works properly with your
  6286.              particular driver, because there is no standard and 100%
  6287.              reliable way to detect an ANSI driver.  See page 25 for more
  6288.              information on ANSI drivers.
  6289.  
  6290.                   SETDOS /A        ANSI Directive _ANSI Value
  6291.  
  6292.                        0 (default) Auto (default) Result of test
  6293.                        1           Yes            1
  6294.                        2           No             0
  6295.  
  6296.     4DOS     _APMAC is the Advanced Power Management AC line status ("on",
  6297.              "off", or "unknown").  An empty string is returned if APM is
  6298.              not installed on your system.  (See the Glossary on page 381
  6299.              for a short description of APM.)
  6300.  
  6301.     4DOS     _APMBATT is the Advanced Power Management battery status
  6302.              ("high", "low", "critical", "charging", or "unknown").  An
  6303.              empty string is returned if APM is not installed.
  6304.  
  6305.     4DOS     _APMLIFE is the Advanced Power Management remaining battery
  6306.              life (0 - 100 or "unknown").  An empty string is returned if
  6307.              APM is not installed.
  6308.  
  6309.  
  6310.         -------------------------------------------------------------------
  6311.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 103
  6312.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6313.         -------------------------------------------------------------------
  6314.  
  6315.  
  6316.              _BATCH is the current batch nesting level.  It is "0" if no
  6317.              batch file is currently being processed.
  6318.  
  6319.              _BATCHLINE is the current line number in the current batch
  6320.              file.  It is "-1" if no batch file is currently being
  6321.              processed.
  6322.  
  6323.              _BATCHNAME is the full pathname of the current batch file.  It
  6324.              is an empty string if no batch file is currently being
  6325.              processed.
  6326.  
  6327.              _BG is a string containing the first three characters of the
  6328.              screen background color at the current cursor location (for
  6329.              example, "Bla").
  6330.  
  6331.              _BOOT is the boot drive letter, without a colon.
  6332.  
  6333.              _CODEPAGE is the current code page number (see CHCP on page
  6334.                 ).             184
  6335.  
  6336.              _COLUMN is the current cursor column (for example, "0" for the
  6337.              left side of the screen).
  6338.  
  6339.              _COLUMNS is the current number of screen columns (for example,
  6340.              "80").
  6341.  
  6342.              _COUNTRY is the current country code.
  6343.  
  6344.                   _CPU is the CPU type:
  6345.  
  6346.                   86    8086 and 8088           386   i386
  6347.                   186   80186 and 80188         486   i486
  6348.                   200   NEC V20 and V30         586   Pentium
  6349.                   286   80286
  6350.  
  6351.              _CWD is the current working directory in the format
  6352.              d:\pathname.
  6353.  
  6354.              _CWDS has the same value as CWD, except it ends the pathname
  6355.              with a backslash [\].
  6356.  
  6357.              _CWP is the current working directory in the format \pathname.
  6358.  
  6359.              _CWPS has the same value as CWP, except it ends the pathname
  6360.              with a backslash [\].
  6361.  
  6362.              _DATE contains the current system date, in the format mm-dd-yy
  6363.              (U.S.), dd-mm-yy (Europe), or yy-mm-dd (Japan).
  6364.  
  6365.              _DAY is the day of the month (1 to 31).
  6366.  
  6367.         -------------------------------------------------------------------
  6368.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 104
  6369.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6370.         -------------------------------------------------------------------
  6371.  
  6372.  
  6373.              _DISK is the current disk drive, without a colon (for example,
  6374.              "C").
  6375.  
  6376.              _DNAME is the name of the file used to store file
  6377.              descriptions.  It can be changed with the DescriptionName
  6378.              directive in the .INI file (see page 148).
  6379.  
  6380.              _DOS is the operating system type ("DOS", "OS2", or "NT").
  6381.              4DOS always returns "DOS", 4OS2 always returns "OS2", and
  6382.              4DOS/NT always returns "NT".  This may be useful if you have
  6383.              batch files running under more than one operating system.
  6384.  
  6385.              _DOSVER is the current operating system version (for example,
  6386.              "6.0").  When running 4DOS in an OS/2 DOS session the version
  6387.              number will be 10.3 for OS/2 1.3, 20.1 for OS/2 2.1, and so
  6388.              on.
  6389.  
  6390.              _DOW is the first three characters of the current day of the
  6391.              week ("Mon", "Tue", "Wed", etc.).
  6392.  
  6393.              _DOY is the day of the year (1 to 366).
  6394.  
  6395.     4DOS     _DPMI returns the DPMI version number, or "0" if DPMI isn't
  6396.              present. (See the Glossary on page 381 for a short description
  6397.              of DPMI.)
  6398.  
  6399.     4DOS     _DV is "1" if DESQview is loaded or "0" otherwise.
  6400.  
  6401.     4DOS     _ENV is the free space in the environment, in bytes.
  6402.  
  6403.              _FG is a string containing the first three letters of the
  6404.              screen foreground color at the current cursor position (for
  6405.              example, "Whi").
  6406.  
  6407.              _HLOGFILE  returns the name of the current history log file
  6408.              (or an empty string if LOG /H is OFF).
  6409.  
  6410.              _HOUR is the current hour (0 - 23).
  6411.  
  6412.              _KBHIT returns "1" if one or more keystrokes are waiting in
  6413.              the keyboard buffer, or "0" if the keyboard buffer is empty.
  6414.  
  6415.     4DOS     _KSTACK returns "1" if KSTACK.COM is loaded or "0" otherwise.
  6416.  
  6417.              _LASTDISK is the last valid drive letter, without a colon.
  6418.  
  6419.              _LOGFILE  returns the name of the current log file (or an
  6420.              empty string if LOG is OFF).
  6421.  
  6422.              _MINUTE is the current minute (0 - 59).
  6423.  
  6424.         -------------------------------------------------------------------
  6425.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 105
  6426.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6427.         -------------------------------------------------------------------
  6428.  
  6429.  
  6430.     4DOS,    _MONITOR is the monitor type ("mono" or "color").
  6431.     4OS2
  6432.  
  6433.              _MONTH is the month of the year (1 to 12).
  6434.  
  6435.              _MOUSE is "1" if a mouse driver is loaded, and "0" otherwise.
  6436.  
  6437.                   _NDP is the coprocessor type:
  6438.  
  6439.                   0     no coprocessor is installed
  6440.                   87    8087
  6441.                   287   80287
  6442.                   387   80387, 80486DX, or Pentium
  6443.  
  6444.     4OS2     _PID is the current process ID number.
  6445.  
  6446.     4OS2,    _PIPE returns "1" if the current process is running inside a
  6447.     4NT      pipe or "0" otherwise.
  6448.  
  6449.     4OS2     _PPID is the process ID number of the parent process.
  6450.  
  6451.     4OS2     _PTYPE is the current OS/2 process type:
  6452.  
  6453.                   AVIO      Character mode, windowed
  6454.                   DT        Detached (no screen in use)
  6455.                   FS        Character mode, full-screen
  6456.                   PM        Presentation Manager
  6457.  
  6458.              _ROW is the current cursor row (for example, "0" for the top
  6459.              of the screen).
  6460.  
  6461.              _ROWS is the current number of screen rows (for example,
  6462.              "25").
  6463.  
  6464.              _SECOND is the current second (0 - 59).
  6465.  
  6466.              _SHELL is the current shell nesting level.  The primary shell
  6467.              is level "0", and each subsequent secondary shell increments
  6468.              the level by 1.
  6469.  
  6470.     4OS2     _SID is the session ID number.
  6471.  
  6472.     4DOS     _SWAPPING returns the current swapping state.  The return
  6473.              value is "OFF" if swapping has been disabled with the SWAPPING
  6474.              command, "EMS" if expanded memory is being used, "XMS" if
  6475.              extended memory is being used, or "Disk" if 4DOS is using disk
  6476.              swapping.  The return value is "None" if swapping has been
  6477.              disabled with the 4DOS.INI Swapping directive or if 4DOS
  6478.              failed to initiate memory or disk swapping during
  6479.              initialization.
  6480.  
  6481.         -------------------------------------------------------------------
  6482.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 106
  6483.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6484.         -------------------------------------------------------------------
  6485.  
  6486.  
  6487.              _SYSERR is the error code of the last operating system error.
  6488.              You will need a technical or programmer's manual to understand
  6489.              these error values.
  6490.  
  6491.              _TIME contains the current system time in the format hh:mm:ss.
  6492.              The separator character may vary depending upon your country
  6493.              information.
  6494.  
  6495.              _TRANSIENT is "1" if the current shell is transient (started
  6496.              with a /C, see your Introduction and Installation Guide for
  6497.              details), or "0" otherwise.
  6498.  
  6499.     4DOS,    _VIDEO is the video card type ("mono", "cga", "ega", or
  6500.     4OS2     "vga").
  6501.  
  6502.              _WIN is the current Microsoft Windows mode.  This variable
  6503.              will always be zero except when 4DOS is running under
  6504.              Microsoft Windows:
  6505.  
  6506.                   0      Windows is not running
  6507.                   1      Windows 2
  6508.                   2      Windows 3 in 386 enhanced mode
  6509.                   3      Windows 3 in real or standard mode
  6510.  
  6511.     4NT      _WINDIR returns the name of the Windows NT directory.
  6512.  
  6513.     4NT      _WINSYSDIR returns the name of the Windows NT system
  6514.              directory.
  6515.  
  6516.              _WINTITLE returns the title of the current window.  This
  6517.              variable is valid in 4OS2 and 4DOS/NT, and in 4DOS when it is
  6518.              running in a DOS session under OS/2.  If you are using 4DOS
  6519.              running under DOS or DOS plus Windows, the return value is an
  6520.              empty string.
  6521.  
  6522.     4NT      _WINVER returns the current Windows NT version number.
  6523.  
  6524.              _YEAR is the current year (1980 to 2099).
  6525.  
  6526.              For FAT drives under DOS, OS/2, and Windows NT 3.1 the _CWD,
  6527.              _CWDS, _CWP, _CWPS, and _DISK variables will return their
  6528.              result in upper or lower case depending on the value of the
  6529.              SETDOS /U switch (see page 326) or the UpperCase directive in                                        
  6530.              the .INI file (see page 141).  On HPFS and NTFS drives, and on
  6531.              FAT drives under Windows NT 3.5 and above,these variables will
  6532.              return names as they are stored on the disk, and no case
  6533.              shifting will be performed (see page 17 for more details).
  6534.  
  6535.              You can use these variables in a wide variety of ways
  6536.              depending on your needs.  Here are just a few examples.  Some
  6537.  
  6538.         -------------------------------------------------------------------
  6539.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 107
  6540.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6541.         -------------------------------------------------------------------
  6542.  
  6543.  
  6544.              of these examples rely on the IF command (page 251) or the IFF
  6545.              command (page 257) to test the value of a variable and perform
  6546.              different actions based on that value.
  6547.  
  6548.              In a 4DOS or 4OS2 batch file, set the color based on the video
  6549.              card type:
  6550.  
  6551.                   iff "%_video"=="mono" then
  6552.                     color bright white on black
  6553.                   else
  6554.                     color bright white on blue
  6555.                   endiff
  6556.  
  6557.              Call another batch file if 4DOS is running under DESQview:
  6558.  
  6559.                   if "%_dv" == "1" call dvstart
  6560.  
  6561.              Store the current date and time in a file, then save the
  6562.              output of a DIR command in the same file:
  6563.  
  6564.                   echo Directory as of %_date %_time > dirsave
  6565.                   dir >> dirsave
  6566.  
  6567.              Set up a prompt for the primary shell which displays the time
  6568.              and current directory, and a different one for secondary
  6569.              shells which includes the shell level rather than the time
  6570.              (see PROMPT on page 295 for details about setting the prompt).
  6571.              Also set different background colors for the two shells,
  6572.              without changing the foreground color.  You might use a
  6573.              sequence like this in your 4START file (see page 85):
  6574.  
  6575.                   iff %_shell==0 then
  6576.                     prompt $t $p$g
  6577.                     color %_fg on blue
  6578.                   else
  6579.                     prompt [$z] $p$g
  6580.                     color %_fg on cyan
  6581.                   endiff
  6582.  
  6583.  
  6584.           ## Variable Functions
  6585.  
  6586.              Variable functions are like internal variables, but they take
  6587.              one or more arguments (which can be environment variables or
  6588.              even other variable functions) and they return a value.
  6589.  
  6590.              Like all environment variables, these variable functions must
  6591.              be preceded by a percent sign in normal use (%@EVAL, %@LEN,
  6592.              etc.).  All variable functions must have square brackets
  6593.              enclosing their argument(s).  The argument(s) to a variable
  6594.  
  6595.         -------------------------------------------------------------------
  6596.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 108
  6597.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6598.         -------------------------------------------------------------------
  6599.  
  6600.  
  6601.              function cannot exceed 255 characters in length for all
  6602.              arguments taken as a group.
  6603.  
  6604.              The variable functions are useful in aliases and batch files
  6605.              to check on available system resources, manipulate strings and
  6606.              numbers, and work with filenames.
  6607.  
  6608.              Some variable functions, like @DISKFREE, are shown with
  6609.              "b|k|m" as one of their arguments.  Those functions return a
  6610.              number of bytes, kilobytes, or megabytes based on the "b|k|m"
  6611.              argument:
  6612.  
  6613.                   b      return the number of bytes
  6614.                   K      return the number of kilobytes (bytes / 1,024)
  6615.                   k      return the number of thousands of bytes (bytes /
  6616.                          1,000)
  6617.                   M      return the number of megabytes (bytes /
  6618.                          1,048,576)
  6619.                   m      return the number of millions of bytes (bytes /
  6620.                          1,000,000)
  6621.  
  6622.              You can include commas in the results from a "b|k|m" function
  6623.              by appending a "c" to the argument.  For example, to add
  6624.              commas to a "b" or number of bytes result, enter "bc" as the
  6625.              argument.
  6626.  
  6627.          !   In variable functions which take a drive letter as an
  6628.              argument, like @DISKFREE or @READY, the drive letter must be
  6629.              followed by a colon.  The function will not work properly if
  6630.              you use the drive letter without the colon.
  6631.  
  6632.          !   The @FILEREAD, @FILEWRITE, @FILESEEK, and @FILECLOSE functions
  6633.              allow you to access files based on their file handle.  These
  6634.              functions should only be used with file handles returned by
  6635.              @FILEOPEN!  If you use them with any other file handle you may
  6636.              damage other files opened by the command processor (or, in a
  6637.              secondary shell, the program which started the command
  6638.              processor), or hang your system.
  6639.  
  6640.              The functions are listed below.  The first list is by
  6641.              category, to assist you in locating the function you want
  6642.              quickly.  The second list includes all the functions in
  6643.              alphabetical order, and defines the arguments and return value
  6644.              for each one.
  6645.  
  6646.  
  6647.  
  6648.  
  6649.  
  6650.  
  6651.  
  6652.         -------------------------------------------------------------------
  6653.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 109
  6654.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6655.         -------------------------------------------------------------------
  6656.  
  6657.  
  6658.              Variable Function Categories
  6659.  
  6660.              System status:
  6661.  
  6662.                @DOSMEM        @EMS           @EXTENDED      @MASTER
  6663.                @READSCR       @XMS
  6664.  
  6665.              Drives and devices:
  6666.  
  6667.                @CDROM         @DEVICE        @DISKFREE      @DISKTOTAL
  6668.                @DISKUSED      @FSTYPE        @LABEL         @LPT
  6669.                @READY         @REMOTE        @REMOVABLE
  6670.  
  6671.              Files:
  6672.  
  6673.                @ATTRIB        @DESCRIPT      @EXETYPE       @FILEAGE
  6674.                @FILECLOSE     @FILEDATE      @FILEOPEN      @FILEREAD
  6675.                @FILES         @FILESEEK      @FILESEEKL     @FILESIZE
  6676.                @FILETIME      @FILEWRITE     @FILEWRITEB    @FINDCLOSE
  6677.                @FINDFIRST     @FINDNEXT      @LINE          @LINES
  6678.                @SEARCH        @TRUENAME      @UNIQUE
  6679.  
  6680.              File names:
  6681.  
  6682.                @EXT           @FILENAME      @FULL          @NAME
  6683.                @PATH
  6684.  
  6685.              Strings and characters:
  6686.  
  6687.                @ASCII         @CHAR          @FORMAT        @INDEX
  6688.                @INSTR         @LEN           @LOWER         @REPEAT
  6689.                @SUBSTR        @TRIM          @UPPER         @WORD
  6690.                @WORDS
  6691.  
  6692.              Numbers and arithmetic:
  6693.  
  6694.                @COMMA         @DEC           @EVAL          @INC
  6695.                @INT           @NUMERIC       @RANDOM
  6696.  
  6697.              Dates and times:
  6698.  
  6699.                @DATE          @MAKEAGE       @MAKEDATE      @MAKETIME
  6700.                @TIME
  6701.  
  6702.              Utility:
  6703.  
  6704.                @ALIAS         @EXEC          @IF            @REXX
  6705.                @SELECT        @TIMER
  6706.  
  6707.  
  6708.  
  6709.         -------------------------------------------------------------------
  6710.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 110
  6711.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6712.         -------------------------------------------------------------------
  6713.  
  6714.  
  6715.              Variable Function Details
  6716.  
  6717.              @ALIAS[name]:  Returns the contents of the specified alias as
  6718.              a string, or a null string if the alias doesn't exist.  When
  6719.              manipulating strings returned by @ALIAS you may need to
  6720.              disable certain special characters with the SETDOS /X command
  6721.              (see page 327).  Otherwise, command separators, redirection
  6722.              characters, and other similar "punctuation" in the alias may
  6723.              be interpreted as part of the current command, rather than
  6724.              part of a simple text string.
  6725.  
  6726.     4NT      @ALTNAME[filename]:  Returns the alternate (8.3 FAT-format)
  6727.              name for the specified file.  Under Windows NT 3.1 this
  6728.              function returns a valid name on HPFS and NTFS drives only.
  6729.              Under Windows NT 3.5 and above it works on all drives.
  6730.  
  6731.              @ASCII[c]:  Returns the numeric value of the specified ASCII
  6732.              character as a string.  For example %@ASCII[A] returns 65.
  6733.              You can put an escape character [<Ctrl-X>] before the actual
  6734.              character to process.  This allows quotes and other special
  6735.              characters as the argument (e.g., %@ASCII[<Ctrl-X>`]).
  6736.  
  6737.              @ATTRIB[filename[,nrhsda]]: Returns a "1" if the specified
  6738.              file has the matching attribute(s); otherwise returns a "0".
  6739.              The attributes are:
  6740.  
  6741.                   N      Normal (no attributes set)  S    System
  6742.                   R      Read-only                   D    Directory
  6743.                   H      Hidden                      A    Archive
  6744.  
  6745.              The attributes (other than N) can be combined (for example
  6746.              %@ATTRIB[MYFILE,HS]).  ATTRIB will only return a 1 if all of
  6747.              the attributes match.
  6748.  
  6749.              If you do not specify any attributes, @ATTRIB will return the
  6750.              attributes of the specified file in the format RHSAD, rather
  6751.              than a "0" or "1".  Attributes which are not set will be
  6752.              replaced with an underscore.  For example. if SECURE.DAT has
  6753.              the read-only, hidden, and archive attributes set,
  6754.              %@ATTRIB[SECURE.DAT] would return "RH_A_" (without the
  6755.              quotes).
  6756.  
  6757.              @CDROM[d:]:  Returns "1" if the drive is a CD-ROM or "0"
  6758.              otherwise.
  6759.  
  6760.              @CHAR[n]:  Returns the character corresponding to an ASCII
  6761.              numeric value.  For example %@CHAR[65] returns A.
  6762.  
  6763.              @COMMA[n]:  Inserts commas, or the "thousands separator"
  6764.              character for your country ID, into a numeric string.
  6765.  
  6766.         -------------------------------------------------------------------
  6767.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 111
  6768.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6769.         -------------------------------------------------------------------
  6770.  
  6771.  
  6772.              @DATE[mm-dd-yy]:  Returns the number of days since January 1,
  6773.              1980 for the specified date.  DATE uses the date format and
  6774.              separators mandated by your country code (for example dd.mm.yy
  6775.              in Germany, or  yy-mm-dd in Japan).
  6776.  
  6777.              @DEC[%var]:  Returns the same value as @EVAL[%var - 1].  That
  6778.              is, it retrieves and decrements the value of a variable.  The
  6779.              variable itself is not changed; to do so, use a command like
  6780.              this:
  6781.  
  6782.                   set var=%@dec[%var]
  6783.  
  6784.              @DESCRIPT[filename]:  Returns the file description for the
  6785.              specified filename (see the DESCRIBE command on page 201).
  6786.  
  6787.              @DEVICE[name]:  Returns "1" if the specified name is a
  6788.              character device (such as a printer or serial port), or "0" if
  6789.              not.
  6790.  
  6791.              @DISKFREE[d:,b|k|m]: Returns the amount of free disk space on
  6792.              the specified drive.
  6793.  
  6794.              @DISKTOTAL[d:,b|k|m]:  Returns the total disk space on the
  6795.              specified drive.
  6796.  
  6797.              @DISKUSED[d:,b|k|m]:  Returns the amount of disk space in use
  6798.              by files and directories on the specified drive.
  6799.  
  6800.              @DOSMEM[b|k|m]:  In 4DOS, returns the amount of free base
  6801.              memory.  In 4OS2, returns the size of the largest free memory
  6802.              block (either in physical or virtual memory).  In 4DOS/NT,
  6803.              returns the amount of free physical memory.
  6804.  
  6805.     4DOS     @EMS[b|k|m]:  Returns the amount of free EMS memory.
  6806.  
  6807.              @EVAL[expression]:  Evaluates an arithmetic expression.  @EVAL
  6808.              supports addition (+), subtraction (-), multiplication (*),
  6809.              division (/), integer division (\, returns the integer part of
  6810.              the quotient), modulo (%%), and integer exponentiation (**).
  6811.              The expression can contain environment variables and other
  6812.              variable functions.  @EVAL also supports parentheses, commas,
  6813.              and decimals.  Parentheses can be nested.  @EVAL will strip
  6814.              leading and trailing zeros from the result.  When evaluating
  6815.              expressions, **, *, /, \, and %% take precedence over + and -.
  6816.              For example, 3 + 4 * 2 will be interpreted as 3 + 8, not as 7
  6817.              * 2.  To change this order of evaluation, use parentheses to
  6818.              specify the order you want.
  6819.  
  6820.              The maximum precision is 16 digits to the left of the decimal
  6821.              point and 8 digits to the right of the decimal point.  You can
  6822.  
  6823.         -------------------------------------------------------------------
  6824.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 112
  6825.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6826.         -------------------------------------------------------------------
  6827.  
  6828.  
  6829.              alter the default precision to the right of the decimal point
  6830.              with the EvalMax and EvalMin .INI file directives (see page
  6831.              138) and with the SETDOS /F command (see page 322).
  6832.  
  6833.              You can alter the precision for a single evaluation with the
  6834.              construct @EVAL[expression=x.y].  The x value specifies the
  6835.              minimum decimal precision (i.e., the minimum number of decimal
  6836.              places displayed); the y value sets the maximum decimal
  6837.              precision.  If x is greater than y, it is ignored.  You can
  6838.              specify either or both arguments, for example:
  6839.  
  6840.                   @eval[3/7=.4]       returns 0.4286
  6841.                   @eval[3/7=2]        returns 0.42857143
  6842.                   @eval[3/6=2.4]      returns 0.50
  6843.  
  6844.              Also see @DEC and @INC.
  6845.  
  6846.              @EXEC[command]:  Execute the command.  The command can be an
  6847.              alias, internal command, external command, .BTM file, or .BAT
  6848.              file.  @EXEC is primarily intended for running a program from
  6849.              within the PROMPT.  It is a "back-door" entry into command
  6850.              processing and should be used with extreme caution.  Incorrect
  6851.              or recursive use of @EXEC may cause stack overflows or hang
  6852.              your system.
  6853.  
  6854.     4OS2     @EXETYPE[filename]:  Returns the application type as a string:
  6855.  
  6856.                   DOS       DOS .COM, .EXE, or .BAT file (OS/2 2.x only)
  6857.                   AVIO      OS/2 Character mode, windowed
  6858.                   FS        OS/2 Character mode, full-screen
  6859.                   PM        OS/2 Presentation Manager
  6860.                   WIN       Windows 3 (OS/2 2.x only)
  6861.                   UNKNOWN   Any other file
  6862.  
  6863.              @EXT[filename]:  Returns the extension from a file name,
  6864.              without a leading period.
  6865.  
  6866.     4DOS     @EXTENDED[b|k|m]:  Returns the amount of extended memory.
  6867.  
  6868.              @FILEAGE[filename]:  Returns the date and time of the file as
  6869.              a single numeric value.  The number can be used to compare the
  6870.              relative ages of two or more files.
  6871.  
  6872.              @FILECLOSE[n]:  Closes the file whose handle is "n."  You
  6873.              cannot close handles 0, 1 or 2.  Returns "0" if the file
  6874.              closed OK or "-1" if an error occurs.  Be sure to read the
  6875.              cautionary note about file functions on page 109.
  6876.  
  6877.              @FILEDATE[filename]:  Returns the date a file was last
  6878.              modified, in the default country format (mm-dd-yy for the US).
  6879.  
  6880.         -------------------------------------------------------------------
  6881.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 113
  6882.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6883.         -------------------------------------------------------------------
  6884.  
  6885.  
  6886.              @FILENAME[filename]:  Returns the name and extension of a
  6887.              file, without a path.
  6888.  
  6889.              @FILEOPEN[filename, read | write | append]:  Opens the file in
  6890.              the specified mode and returns the file handle as an integer.
  6891.              Returns "-1" if the file cannot be opened.  Be sure to read
  6892.              the cautionary note about file functions on page 109.
  6893.  
  6894.              @FILEREAD[n[,length]]:  Reads data from the file whose handle
  6895.              is "n."  Returns "**EOF**" if you attempt to read past the end
  6896.              of the file.  If "length" is not specified @FILEREAD will read
  6897.              until the next CR or LF (end of line) character.  If "length"
  6898.              is specified, @FILEREAD will read "length" bytes regardless of
  6899.              any end of line characters.  Be sure to read the cautionary
  6900.              note about file functions on page 109.
  6901.  
  6902.              @FILES[filename [,-nrhsda]]:  Returns the number of files that
  6903.              match the filename specification, which may contain wildcards
  6904.              and include lists.  Returns an empty string if no files match.
  6905.              The filename must refer to a single directory; to check
  6906.              several directories, use @FILES once for each directory, and
  6907.              add the results together with @EVAL. The second argument, if
  6908.              included, defines the attributes of the files that will be
  6909.              included in the search. The attributes are:
  6910.  
  6911.                   N      Normal (no attributes set)  S    System
  6912.                   R      Read-only                   D    Directory
  6913.                   H      Hidden                      A    Archive
  6914.  
  6915.              The attributes (other than N) can be combined (for example
  6916.              %@FILES[MYFILE,HS]).  @FILES will only find a file if all of
  6917.              the attributes match.  You can prefix an attribute with "-" to
  6918.              mean "everything except files with this attribute."
  6919.  
  6920.              @FILESEEK[n,offset,start]:  Moves the file pointer "offset"
  6921.              bytes in the file whose handle is "n".  Returns the new
  6922.              position of the pointer, in bytes from the start of the file.
  6923.              Set "start" to 0 to seek relative to the beginning of the
  6924.              file, 1 to seek relative to the current file pointer, or 2 to
  6925.              seek relative to the end of the file.  The offset value may be
  6926.              negative (seek backward), positive (seek forward), or zero
  6927.              (return current position, but do not change it).  Be sure to
  6928.              read the cautionary note about file functions on page 109.
  6929.  
  6930.              @FILESEEKL[n,line]:  Moves the file pointer to the specified
  6931.              line in the file whose handle is "n". Returns the new position
  6932.              of the pointer, in bytes from the start of the file. Be sure
  6933.              to read the cautionary note about file functions on page 109.
  6934.  
  6935.  
  6936.  
  6937.         -------------------------------------------------------------------
  6938.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 114
  6939.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6940.         -------------------------------------------------------------------
  6941.  
  6942.  
  6943.              @FILESIZE[filename,b|k|m]:  Returns the size of a file, or
  6944.              "-1" if the file does not exist.  If the filename includes
  6945.              wildcards or an include list, returns the combined size of all
  6946.              matching files.
  6947.  
  6948.              @FILETIME[filename]:  Returns the time a file was last
  6949.              modified, in hh:mm format.
  6950.  
  6951.              @FILEWRITE[n,text]:  Writes a line to the file whose handle is
  6952.              "n".  Returns the number of bytes written, or "-1" if an error
  6953.              occurred.  Be sure to read the cautionary note about file
  6954.              functions on page 109.
  6955.  
  6956.              @FILEWRITEB[n,length,string]:  Writes the specified number of
  6957.              bytes from the string to the file whose handle is "n".
  6958.              Returns the number of bytes written, or "-1" if an error
  6959.              occurred.  Be sure to read the cautionary note about file
  6960.              functions on page 109.
  6961.  
  6962.     4NT      FINDCLOSE[filename]:  Signals the end of a @FINDFIRST /
  6963.              @FINDNEXT sequence.  You must use this function to release the
  6964.              directory search handle used for @FINDFIRST / @FINDNEXT.
  6965.  
  6966.              @FINDFIRST[filename [,-nrhsda]]:  Returns the name of the
  6967.              first file that matches the filename, which may contain
  6968.              wildcards and "include lists".  The second argument, if
  6969.              included, defines the attributes of the files that will be
  6970.              included in the search.  Returns an empty string if no files
  6971.              match.  The attributes are:
  6972.  
  6973.                   N      Normal (no attributes set)  S    System
  6974.                   R      Read-only                   D    Directory
  6975.                   H      Hidden                      A    Archive
  6976.  
  6977.              The attributes (other than N) can be combined (for example
  6978.              %@FINDFIRST[MYFILE,HS]).  @FINDFIRST will only find a file if
  6979.              all of the attributes match.  You can prefix an attribute with
  6980.              "-" to mean "everything except files with this attribute."
  6981.  
  6982.     4NT      After @FINDFIRST or the last @FINDNEXT, you must use
  6983.              @FINDCLOSE to avoid running out of directory search handles.
  6984.  
  6985.              @FINDNEXT[[filename [,-nrhsda]]]:  Returns the name of the
  6986.              next file that matches the filename passed to @FINDFIRST.
  6987.              @FINDNEXT should only be used after a successful call to
  6988.              @FINDFIRST.  The first argument is included for compatibility
  6989.              with previous versions, but is ignored; it can be omitted if
  6990.              the second argument is not used (e.g. %@FINDNEXT[]).  The
  6991.              second argument, if included, defines the attributes of the
  6992.  
  6993.  
  6994.         -------------------------------------------------------------------
  6995.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 115
  6996.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  6997.         -------------------------------------------------------------------
  6998.  
  6999.  
  7000.              files that will be included in the search (see @FINDFIRST for
  7001.              details).  Returns an empty string when no more files match.
  7002.  
  7003.     4NT      After the last @FINDNEXT, you must use @FINDCLOSE to avoid
  7004.              running out of directory search handles.
  7005.  
  7006.              @FORMAT[[-][x][.y],string]: Reformats a string, truncating it
  7007.              or padding it with spaces as necessary.  If you use the minus
  7008.              [-], the string is left-justified; otherwise, it is right-
  7009.              justified.  The x value is the minimum number of characters in
  7010.              the result.  The y value is the maximum number of characters
  7011.              in the result.  You can combine the options as necessary.  For
  7012.              example:
  7013.  
  7014.                   %@format[12,JPSoftware]  returns "  JPSoftware"
  7015.                   %@format[.3,JPSoftware]  returns "JPS"
  7016.  
  7017.     4OS2,    @FSTYPE[d:]:  Returns the file system type for the specified
  7018.              drive.  Under
  7019.     4NT      4OS2, @FSTYPE will return "FAT" for a DOS-compatible drive
  7020.              with a file allocation table, "HPFS" for a drive that uses
  7021.              OS/2's high performance file system, or "CDFS" for a CD-ROM
  7022.              drive.  It may return other values if additional file systems
  7023.              have been installed with the IFS= directive in CONFIG.SYS.
  7024.              4DOS/NT will normally return "FAT", "HPFS", "CDFS", or "NTFS"
  7025.              for a drive that uses the Windows NT file system.
  7026.  
  7027.              @FULL[filename]:  Returns the fully qualified path name of a
  7028.              file.
  7029.  
  7030.              @IF[condition,true,false]:  Evaluates the condition and
  7031.              returns a string based on the result.  The condition can
  7032.              include any of the tests allowed in the IF command (see page
  7033.              251).  If the condition is true, @IF returns the first result
  7034.              string; if it is false, @IF returns the second string.  For
  7035.              example, %IF[2==2,Correct!,Oops!] returns "Correct!"
  7036.  
  7037.              @INC[%var]:  Returns the same value as %@EVAL[%var + 1].  That
  7038.              is, it retrieves and increments the value of a variable.  The
  7039.              variable itself is not changed; to do so, use a command like
  7040.              this:
  7041.  
  7042.                   set var=%@inc[%var]
  7043.  
  7044.              @INDEX[string1,string2]:  Returns the position of string2
  7045.              within string1, or "-1" if string2 is not found.  The first
  7046.              position in string1 is numbered 0.
  7047.  
  7048.              @INSTR[start, length, string]:  The same as @SUBSTR (see page
  7049.              119).  However, the string is at the end of the @INSTR
  7050.  
  7051.         -------------------------------------------------------------------
  7052.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 116
  7053.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  7054.         -------------------------------------------------------------------
  7055.  
  7056.  
  7057.              argument list, so that commas in the string will not be
  7058.              confused with commas separating the arguments.
  7059.  
  7060.              @INT[n]:  Returns the integer part of the number n.
  7061.  
  7062.              @LABEL[d:]:  Returns the volume label of the specified disk
  7063.              drive.
  7064.  
  7065.              @LEN[string]:  Returns the length of a string.
  7066.  
  7067.              @LINE[filename,n]:  Returns line "n" from the specified file.
  7068.              The first line in the file is numbered 0.  "**EOF**" is
  7069.              returned for all line numbers beyond the end of the file.  If
  7070.              you need to scan through the lines of a file in sequence, the
  7071.              @FILEREAD function (above) and the "@filename" construct
  7072.              available in the FOR command (page 237) are much faster than
  7073.              calling the @LINE function repeatedly.  @LINE will retrieve
  7074.              input from standard input if you specify CON as the filename.
  7075.              If you are redirecting input to @LINE using this feature, you
  7076.              must use command grouping (see page 71) or the redirection
  7077.              will not work properly.  For example:
  7078.  
  7079.                   (echo %@line[con,0]) < myfile.dat
  7080.  
  7081.              @LINES[filename]:  Returns the line number of the last line in
  7082.              the file, or "-1" if the file is empty.  The first line in the
  7083.              file is numbered 0, so (for example) @LINES will return 0 for
  7084.              a file containing one line.
  7085.  
  7086.              @LOWER[string]:  Returns the string converted to lower case.
  7087.  
  7088.     4DOS     @LPT[n]:  Returns a "1" if the specified printer is ready;
  7089.              otherwise, returns "0".  n=1 checks the printer connected to
  7090.              LPT1, n=2 checks LPT2, and n=3 checks LPT3.
  7091.  
  7092.              @MAKEAGE[date[,time]]:  Returns the date and time (if
  7093.              included) as a single value in the same format as @FILEAGE.
  7094.              @MAKEAGE can be used to compare the time stamp of a file with
  7095.              a specific date and time, for example:
  7096.  
  7097.                   if %@fileage[myfile] lt %@makeage[1/1/85] echo OLD!
  7098.  
  7099.              @MAKEDATE[n]:  Returns a date (formatted according to the
  7100.              current country settings).  "n" is the number of days since
  7101.              1/1/80.  This is the inverse of @DATE.
  7102.  
  7103.              @MAKETIME[n]:  Returns a time (formatted according to the
  7104.              current country settings).  "n" is the number of seconds since
  7105.              midnight.  This is the inverse of @TIME.
  7106.  
  7107.  
  7108.         -------------------------------------------------------------------
  7109.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 117
  7110.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  7111.         -------------------------------------------------------------------
  7112.  
  7113.  
  7114.     4DOS     @MASTER[varname]:  Returns the value of a variable from the
  7115.              master environment.
  7116.  
  7117.              @NAME[filename]:  Returns the base name of a file, without the
  7118.              path or extension.
  7119.  
  7120.              @NUMERIC[string]:  Returns "1" if the argument is composed
  7121.              entirely of digits (0 to 9), signs (+ or -), and the thousands
  7122.              and decimals separators.  Otherwise, returns "0".
  7123.  
  7124.              @PATH[filename]:  Returns the path from a file name, including
  7125.              the drive letter and a trailing backslash but not including
  7126.              the base name or extension.
  7127.  
  7128.              @RANDOM[min, max]:  Returns a random value between min and
  7129.              max, inclusive.  Min, max, and the returned value are all
  7130.              integers.
  7131.  
  7132.              @READSCR[row,col,length]:  Returns the text displayed on the
  7133.              screen at the specified location.  The upper left corner of
  7134.              the screen is location 0,0.
  7135.  
  7136.              @READY[d:]:  Returns "1" if the specified drive is ready;
  7137.              otherwise returns "0".
  7138.  
  7139.              @REMOTE[d:]:  Returns "1" if the specified drive is a remote
  7140.              (network) drive; otherwise returns "0".
  7141.  
  7142.              @REMOVABLE[d:]:  Returns "1" if the specified drive is
  7143.              removable (i.e., a floppy disk or removable hard disk);
  7144.              otherwise returns "0".
  7145.  
  7146.              @REPEAT[c,n]:  Returns the character "c" repeated "n" times.
  7147.  
  7148.     4OS2     @REXX[expr]:  Calls the REXX interpreter to execute the
  7149.     4NT      expression.  Returns the result string from REXX; if the REXX
  7150.              expression does not return a string, @REXX returns the REXX
  7151.              numeric result code.
  7152.  
  7153.              @SEARCH[filename]:  Searches for the filename using the PATH
  7154.              environment variable, appending an extension if one isn't
  7155.              specified.  See page 20 for details on the default extensions
  7156.              used when searching the PATH, and the order in which the
  7157.              search proceeds.  Returns the fully-expanded name of the file
  7158.              including drive, path, base name, and extension, or an empty
  7159.              string if a matching file is not found.  If wildcards are used
  7160.              in the filename, @SEARCH will search for the first file that
  7161.              matches the wildcard specification, and return the drive and
  7162.              path for that file plus the wildcard filename (e.g.,
  7163.              E:\UTIL\*.COM).
  7164.  
  7165.         -------------------------------------------------------------------
  7166.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 118
  7167.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  7168.         -------------------------------------------------------------------
  7169.  
  7170.  
  7171.              @SELECT[filename,top,left,bottom,right,title]:  Pops up a
  7172.              selection window with the lines from the specified file.
  7173.              Returns the text of the line the scrollbar is on if you press
  7174.              Enter, or an empty string if you press Esc.  @SELECT can be
  7175.              used to display menus or other selection lists from a batch
  7176.              file.  To select from lines passed through input redirection
  7177.              or a pipe, use CON as the filename.  You can move through the
  7178.              selection window with standard navigation keystrokes.  To
  7179.              change the navigation keys, see page 146.
  7180.  
  7181.              @SUBSTR[string,start,length]:  Returns a substring, starting
  7182.              at the position "start" and continuing for "length"
  7183.              characters.  If the length is omitted, it will default to the
  7184.              remainder of the string.  If the length is negative, the start
  7185.              is relative to the right side of the string.  The first
  7186.              character in the string is numbered 0; if the length is
  7187.              negative, the last character is numbered 0.  For example,
  7188.              %@SUBSTR[%_TIME,0,2] gets the current time and extracts the
  7189.              hour.  If the string includes commas, it must be quoted with
  7190.              double quotes ["] or back-quotes [`].  The quotes do count in
  7191.              calculating the position of the substring.  @INSTR (page 116)
  7192.              performs the same function, and allows commas in the string
  7193.              without quoting.
  7194.  
  7195.              @TIME[hh:mm:ss]:  Returns the number of seconds since midnight
  7196.              for the specified time.  The time must be in 24-hour format;
  7197.              "am" and "pm" cannot be used.
  7198.  
  7199.              @TIMER[n]:  Returns the current split time for a stopwatch
  7200.              started with the TIMER command (see page 344).  The value of n
  7201.              specifies the timer to read and can be 1, 2, or 3.
  7202.  
  7203.              @TRIM[string]:  Returns the string with the leading and
  7204.              trailing white space (space and tab characters) removed.
  7205.  
  7206.     4DOS     @TRUENAME[filename]:  Returns the true, fully-expanded name
  7207.              for a file.  TRUENAME will "see through" a JOIN or SUBST, and
  7208.              requires DOS 3.0 or above.  Wildcards may not be used in the
  7209.              filename.  @TRUENAME can handle simple drive substitutions
  7210.              such as those created by JOIN, SUBST, or most network drive
  7211.              mappings.  However it may not be able to correctly determine
  7212.              the true name if you use "nested" JOIN or SUBST commands, or a
  7213.              network which does not report true names properly.
  7214.  
  7215.              @UNIQUE[d:\path]:  Creates a zero-length file with a unique
  7216.              name in the specified directory, and returns the full name and
  7217.              path.  If no path is specified, the file will be created in
  7218.              the current directory.  The file name will be FAT-compatible
  7219.              (8 character name and 3-character extension) regardless of
  7220.              whether the file is created on a FAT, HPFS, or NTFS drive.
  7221.  
  7222.         -------------------------------------------------------------------
  7223.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 119
  7224.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  7225.         -------------------------------------------------------------------
  7226.  
  7227.  
  7228.              This function allows you to create a  temporary file without
  7229.              overwriting an existing file.
  7230.  
  7231.              @UPPER[string]:  Returns the string converted to upper case.
  7232.  
  7233.              @WORD[["xxx",]n,string]:  Returns the "nth" word in a string.
  7234.              The first word is numbered 0.  If "n" is negative, words are
  7235.              returned from the end of the string.  You can use the first
  7236.              argument, "xxx" to specify the separators that you wish to
  7237.              use.  If you want to use a double quote as a separator, prefix
  7238.              it with an escape character (see page 73).  If you don't
  7239.              specify a list of separators, @WORD will consider only spaces,
  7240.              tabs, and commas as word separators.  If the string argument
  7241.              is enclosed in quotation marks, you must enter a list of
  7242.              separators.  For example:
  7243.  
  7244.                   %@word[2,NOW IS THE TIME]     returns "THE"
  7245.                   %@word[-0,NOW IS THE TIME]    returns "TIME"
  7246.                   %@word[-2,NOW IS THE TIME]    returns "IS"
  7247.                   %@word["=",1,2 + 2=4]         returns "4"
  7248.  
  7249.              @WORDS[["xxx"],string]:  Returns the number of words in the
  7250.              string.  The optional list of delimiters follows the same
  7251.              format as @WORD.  If the string argument is enclosed in
  7252.              quotation marks, you must enter a list of delimiters as well.
  7253.  
  7254.     4DOS     @XMS[b|k|m]:  Returns the amount of free XMS memory.
  7255.  
  7256.  
  7257.              Examples
  7258.  
  7259.              You can use variable functions in a wide variety of ways
  7260.              depending on your needs.  We've included a few examples below
  7261.              to give you an idea of what's possible.
  7262.  
  7263.              To set the prompt to show the amount of free memory (see the
  7264.              PROMPT command, page 295,  for details on including variable
  7265.              functions in your prompt):
  7266.  
  7267.                   c:\> prompt (%%@dosmem[K]K) $p$g
  7268.  
  7269.              Set up a simple command-line calculator.  The calculator is
  7270.              used with a command like CALC 3 * (4 + 5):
  7271.  
  7272.                   c:\> alias calc `echo The answer is:  %@eval[%&]`
  7273.  
  7274.              The following batch file uses variable functions to implement
  7275.              "once a day" execution of a group of commands.  It works by
  7276.              constructing a 6-digit number "yymmdd" from today's date, and
  7277.              comparing that to a number of the same type stored in the file
  7278.  
  7279.         -------------------------------------------------------------------
  7280.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 120
  7281.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  7282.         -------------------------------------------------------------------
  7283.  
  7284.  
  7285.              C:\ONCEADAY.DAT.  If today's date is numerically larger than
  7286.              the saved date, and the time is after 6:00 AM, then the "once
  7287.              a day" commands are run, and today's date is saved in the file
  7288.              as the new date for comparison.  Otherwise, no action is
  7289.              taken.  You can make this file simpler using the %@DATE and
  7290.              %@TIME functions instead of using %@SUBSTR to extract
  7291.              substrings of the %_DATE and %_TIME variables; we used the
  7292.              approach shown to demonstrate the use of %@SUBSTR.
  7293.  
  7294.                   rem  Temporary variables used to shorten example lines:
  7295.                   rem    DD is _date, DY is yymmdd date, TM is _time
  7296.                   set dd=%_date
  7297.                   set
  7298.                   dy=%@substr[%dd,6,2]%@substr[%dd,0,2]%@substr[%dd,3,2]
  7299.                   set lastdate=0
  7300.                   iff exist c:\onceaday.dat then
  7301.                     set lastdate=%@line[onceaday.dat,0]
  7302.                   endiff
  7303.                   iff %dy gt %lastdate then
  7304.                     set tm=%_time
  7305.                     iff "%@substr[%tm,0,2]%@substr[%tm,3,2]" gt "0600" then
  7306.                       rem Commands to be executed once a day go here
  7307.                       echo %dy > c:\onceaday.dat
  7308.                     endiff
  7309.                   endiff
  7310.  
  7311.  
  7312.         Command Parsing
  7313.  
  7314.              Whenever you type something at the command line and press the
  7315.              Enter key, or include a command in a batch file, you have
  7316.              given a command to 4DOS, 4OS2, or 4DOS/NT, which must figure
  7317.              out how to execute your command.  If you understand the
  7318.              general process that is used, you will be able to make the
  7319.              best use of the commands.  Understanding these steps can be
  7320.              especially helpful when working with complex aliases or batch
  7321.              file commands.
  7322.  
  7323.              To decide what activity to perform, the command processor goes
  7324.              through several steps.  Before it starts, it writes the entire
  7325.              command line (which may contain multiple commands) to the
  7326.              history log file if history logging has been enabled with the
  7327.              LOG /H command (see page 277).  Then, if the line contains
  7328.              multiple commands, the first command is isolated for
  7329.              processing.
  7330.  
  7331.              4DOS, 4OS2, and 4DOS/NT begin by dividing the command into a
  7332.              command name and a command tail.  The command name is the
  7333.              first word in the command; the tail is everything that follows
  7334.              the command name.  For example, in the command line
  7335.  
  7336.         -------------------------------------------------------------------
  7337.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 121
  7338.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  7339.         -------------------------------------------------------------------
  7340.  
  7341.  
  7342.                   dir *.txt /2/p/v
  7343.  
  7344.              the command name is "dir," and the command tail is " *.txt
  7345.              /2/p/v."
  7346.  
  7347.              Next the command processor tries to match the command name
  7348.              against its list of aliases.  If it finds a match between the
  7349.              command name and one of the aliases you've defined, it
  7350.              replaces the command name with the contents of the alias.
  7351.              (This substitution is done internally and is not normally
  7352.              visible to you).  If the alias included parameters (%1, %2,
  7353.              etc.), the parameter values are filled in from the text on the
  7354.              command line, and any parameters used in this process are
  7355.              removed from the command line.  The process of replacing a
  7356.              command name that refers to an alias with the contents of the
  7357.              alias, and filling in the alias parameters, is called alias
  7358.              expansion.
  7359.  
  7360.              This expansion of an alias creates a new command name:  the
  7361.              first word of the alias.  This new command name is again
  7362.              tested against the list of aliases, and if a match is found
  7363.              the contents of the new alias is expanded just like the first
  7364.              alias.  This process, called nested alias expansion, continues
  7365.              until the command name no longer refers to an alias.
  7366.  
  7367.              Once it has finished with the aliases, 4DOS, 4OS2, or 4DOS/NT
  7368.              next tries to match the command name with its list of internal
  7369.              commands.  If it is unsuccessful, the command processor knows
  7370.              that it will have to search for a batch file or external
  7371.              program to execute your command.
  7372.  
  7373.              The next step is to locate any batch file or alias parameters,
  7374.              environment variables, internal variables, or variable
  7375.              functions in the command, and replace each one with its value.
  7376.              This process is called variable expansion.
  7377.  
  7378.              The variable expansion process is modified for certain
  7379.              internal commands, like EXCEPT, IFF, and GLOBAL.  These
  7380.              commands are always followed by another command, so variable
  7381.              expansion takes place separately for the original command and
  7382.              the command that follows it.
  7383.  
  7384.              Once all of the aliases and environment variables have been
  7385.              expanded, 4DOS, 4OS2, or 4DOS/NT will echo the complete
  7386.              command to the screen (if command-line echo has been enabled)
  7387.              and write it to the log file (if command logging has been
  7388.              turned on).
  7389.  
  7390.              Before it can actually execute your command, the command
  7391.              processor must scan the command tail to see if it includes
  7392.  
  7393.         -------------------------------------------------------------------
  7394.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 122
  7395.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  7396.         -------------------------------------------------------------------
  7397.  
  7398.  
  7399.              redirection or piping.  If so, the proper internal switches
  7400.              are set to send output to an alternate device or to a file,
  7401.              instead of to the screen.  In 4OS2 and 4DOS/NT, a second
  7402.              process is started at this point, if necessary, to receive any
  7403.              piped output.
  7404.  
  7405.              Finally, it is time to execute the command.  If the command
  7406.              name matches an internal command, 4DOS, 4OS2, or 4DOS/NT will
  7407.              perform the activities you have requested.  Otherwise, the
  7408.              command processor searches for an executable (.COM or .EXE)
  7409.              file, a batch file, or a file with an executable extension
  7410.              that matches the command name (see the detailed description of
  7411.              this search on page 20).
  7412.  
  7413.              Once the internal command or external program has terminated,
  7414.              the command processor saves the result or exit code that the
  7415.              command generated, cleans up any redirection that you
  7416.              specified, and then returns to the original command line to
  7417.              retrieve the next command.  When all of the commands in a
  7418.              command line are finished, the next line is read from the
  7419.              current batch file, or if no batch file is active, the prompt
  7420.              is displayed.
  7421.  
  7422.              You can disable and re-enable several parts of command parsing
  7423.              (for example alias expansion, variable expansion, and
  7424.              redirection) with the SETDOS /X command (see page 327).
  7425.  
  7426.  
  7427.              Argument Quoting
  7428.  
  7429.              As it parses the command line, the command processor looks for
  7430.              command separators (carets [^] in 4DOS, or ampersands [&] in
  7431.              4OS2 and 4DOS/NT), conditional commands (|| or &&), white
  7432.              space (spaces, tabs, and commas), percent signs [%] which
  7433.              indicate variables to be expanded, and redirection and piping
  7434.              characters (>, <, or |).
  7435.  
  7436.              Normally, these special characters cannot be passed to a
  7437.              command as part of an argument.  However, you can include any
  7438.              of the special characters in an argument by enclosing the
  7439.              entire argument in back-quotes [`] or double quotes ["].
  7440.              Although both back-quotes and double quotes will let you build
  7441.              arguments that include special characters, they do not work
  7442.              the same way.
  7443.  
  7444.              No alias or variable expansion is performed on an argument
  7445.              enclosed in back-quotes.  Redirection symbols inside the back-
  7446.              quotes are ignored.  The back-quotes are removed from the
  7447.              command line before the command is executed.
  7448.  
  7449.  
  7450.         -------------------------------------------------------------------
  7451.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 123
  7452.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  7453.         -------------------------------------------------------------------
  7454.  
  7455.  
  7456.              No alias expansion is performed on expressions enclosed in
  7457.              double quotes.  Redirection symbols inside double quotes are
  7458.              ignored.  However, variable expansion is performed on
  7459.              expressions inside double quotes.  The double quotes
  7460.              themselves will be passed to the command as part of the
  7461.              argument.
  7462.  
  7463.              For example, suppose you have a batch file CHKNAME.BTM which
  7464.              expects a name as its first parameter (%1).  Normally the name
  7465.              is a single word.  If you need to pass a two-word name with a
  7466.              space in it to this batch file you could use the command:
  7467.  
  7468.                   c:\> chkname `MY NAME`
  7469.  
  7470.              Inside the batch file, %1 will have the value MY NAME,
  7471.              including the space.  The back-quotes caused the command
  7472.              processor to pass the string to the batch file as a single
  7473.              argument.
  7474.  
  7475.              For a more complex example, suppose the batch file QUOTES.BAT
  7476.              contains the following commands:
  7477.  
  7478.                   @echo off
  7479.                   echo Arg1 = %1
  7480.                   echo Arg2 = %2
  7481.                   echo Arg3 = %3
  7482.  
  7483.              and that the environment variable FORVAR has been defined with
  7484.              this command:
  7485.  
  7486.                   c:\> set FORVAR=for
  7487.  
  7488.              Now, if you enter the command
  7489.  
  7490.                   c:\> quotes `Now is the time %forvar` all good
  7491.  
  7492.              the output from QUOTES.BAT will look like this:
  7493.  
  7494.                   Arg1 = Now is the time %forvar
  7495.                   Arg2 = all
  7496.                   Arg3 = good
  7497.  
  7498.              But if you enter the command
  7499.  
  7500.                   c:\> quotes "Now is the time %forvar" all good
  7501.  
  7502.              the output from QUOTES.BAT will look like this:
  7503.  
  7504.  
  7505.  
  7506.  
  7507.         -------------------------------------------------------------------
  7508.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 124
  7509.                                         CHAPTER 4 / ALIASES AND BATCH FILES
  7510.         -------------------------------------------------------------------
  7511.  
  7512.  
  7513.                   Arg1 = "Now is the time for"
  7514.                   Arg2 = all
  7515.                   Arg3 = good
  7516.  
  7517.              Notice that in both cases, the quotes keep characters together
  7518.              and reduce the number of arguments in the line.
  7519.  
  7520.              The following example has 7 command-line arguments, while the
  7521.              examples above only have 3:
  7522.  
  7523.                   c:\> quotes Now is the time %forvar all good
  7524.  
  7525.              When an alias is defined in a batch file or from the command
  7526.              line, its argument can be enclosed in back-quotes to prevent
  7527.              the expansion of replaceable parameters, variables, and
  7528.              multiple commands until the alias is invoked.  See ALIAS on
  7529.              page 161 for details.
  7530.  
  7531.              You can disable and re-enable back-quotes and double quotes
  7532.              with the SETDOS /X command (see page 327).
  7533.  
  7534.  
  7535.  
  7536.  
  7537.  
  7538.  
  7539.  
  7540.  
  7541.  
  7542.  
  7543.  
  7544.  
  7545.  
  7546.  
  7547.  
  7548.  
  7549.  
  7550.  
  7551.  
  7552.  
  7553.  
  7554.  
  7555.  
  7556.  
  7557.  
  7558.  
  7559.  
  7560.  
  7561.  
  7562.  
  7563.  
  7564.         -------------------------------------------------------------------
  7565.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 125
  7566.                                                   CHAPTER 5 / CONFIGURATION
  7567.         -------------------------------------------------------------------
  7568.  
  7569.  
  7570.  
  7571.         CHAPTER 5 / CONFIGURATION
  7572.  
  7573.  
  7574.         Part of the power of 4DOS, 4OS2, and 4DOS/NT is their flexibility.
  7575.         You can alter their configuration to match your style of computing.
  7576.         This chapter explains how to make the command processor work the
  7577.         way you want.
  7578.  
  7579.         The configuration of 4DOS, 4OS2, and 4DOS/NT is controlled through
  7580.         an optional file of initialization information with the extension
  7581.         .INI.  This file is called 4DOS.INI in 4DOS, 4OS2.INI in 4OS2, and
  7582.         4NT.INI in 4DOS/NT.  (For brevity, we refer to all three files as
  7583.         .INI files throughout this manual.)
  7584.  
  7585.         You can create, add to, and edit the .INI file with any ASCII text
  7586.         editor.  Each command processor reads its .INI file when it starts,
  7587.         and configures itself accordingly.  The .INI file is not re-read
  7588.         when you change it.  For changes to take effect, you must reboot
  7589.         your system (under DOS), or restart the session or window in which
  7590.         your command processor is running (under OS/2 or Windows NT).
  7591.  
  7592.         Each item that you can include in the .INI file has a default
  7593.         value.  You only need to include entries in the file for settings
  7594.         that you want to change from their default values.  If you are
  7595.         happy with all of the default values, you don't need an .INI file
  7596.         at all.
  7597.  
  7598.  
  7599.         Using the .INI File
  7600.  
  7601.              Some settings in the .INI file are initialized when you
  7602.              install 4DOS, 4OS2, or 4DOS/NT, so you may have an .INI file
  7603.              even if you didn't create one yourself.  You should not delete
  7604.              this file unless you've checked carefully to be sure that you
  7605.              don't need any of the settings the installation program put
  7606.              there.
  7607.  
  7608.              4DOS, 4OS2, and 4DOS/NT primary shells search for the .INI
  7609.              file in three places:
  7610.  
  7611.                   * If there is an "@d:\path\inifile" option on the SHELL=
  7612.                     line in CONFIG.SYS (for 4DOS) or on the startup
  7613.                     command line (for 4OS2 and 4DOS/NT), the command
  7614.                     processor will use the path and file name specified
  7615.                     there, and will not look elsewhere.
  7616.  
  7617.                   * If there is no .INI file name on the SHELL= line or
  7618.                     startup command line, the search proceeds to the same
  7619.                     directory where the command processor program file
  7620.  
  7621.         -------------------------------------------------------------------
  7622.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 126
  7623.                                                   CHAPTER 5 / CONFIGURATION
  7624.         -------------------------------------------------------------------
  7625.  
  7626.  
  7627.                     (4DOS.COM, 4OS2.EXE, or 4NT.EXE) is stored.  This is
  7628.                     the "normal" location for the .INI file.  4DOS, 4OS2,
  7629.                     and 4DOS/NT determine this directory automatically.
  7630.                     You can also set it yourself by placing a COMSPEC
  7631.                     directory name on the SHELL= line in CONFIG.SYS (for
  7632.                     4DOS), or on the startup command line (for 4OS2 and
  7633.                     4DOS/NT).  See your Introduction and Installation
  7634.                     Guide for further details on setting the COMSPEC
  7635.                     directory.
  7636.  
  7637.                   * If the .INI file is not found in the directory where
  7638.                     the program file is stored, a final check is made in
  7639.                     the root directory of the boot drive.
  7640.  
  7641.              When 4DOS, 4OS2, or 4DOS/NT is loaded as a secondary shell, it
  7642.              does not search for the .INI file.  Instead, it retrieves the
  7643.              primary shell's .INI file data, processes the [Secondary]
  7644.              section of the original .INI file if necessary, and then
  7645.              processes any "@d:\path\inifile" option on the secondary shell
  7646.              command line (see your Introduction and Installation Guide for
  7647.              details).  You can override this behavior with the NextINIFile
  7648.              directive (see page 148).
  7649.  
  7650.  
  7651.         .INI File Directives
  7652.  
  7653.              Most lines in the .INI file consist of a one-word directive,
  7654.              an equal sign [=], and a value.  For example, in the following
  7655.              line, the word "Environment" is the directive and "2048" is
  7656.              the value:
  7657.  
  7658.                   Environment = 2048
  7659.  
  7660.              Any spaces before or after the equal sign are ignored.
  7661.  
  7662.              If you have a long string to enter in the .INI file (for
  7663.              example, for the ColorDir directive), you must enter it all on
  7664.              one line.  Strings cannot be "continued" to a second line.
  7665.              Each line may be up to 511 characters long in 4DOS, or 1023
  7666.              characters long in 4OS2 and 4DOS/NT.
  7667.  
  7668.              The format of the value part of a directive line depends on
  7669.              the individual directive.  It may be a numeric value, a single
  7670.              character, a choice (like "Yes" or "No"), a color setting, a
  7671.              key name, a path, a filename, or a text string.  The value
  7672.              begins with the first non-blank character after the equal sign
  7673.              and ends at the end of the line or the beginning of a comment.
  7674.  
  7675.              Blank lines are ignored in the .INI file and can be used to
  7676.              separate groups of directives.  You can place comments in the
  7677.  
  7678.         -------------------------------------------------------------------
  7679.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 127
  7680.                                                   CHAPTER 5 / CONFIGURATION
  7681.         -------------------------------------------------------------------
  7682.  
  7683.  
  7684.              file by beginning a line with a semicolon [;].  You can also
  7685.              place comments at the end of any line except one containing a
  7686.              text string value.  To do so, enter at least one space or tab
  7687.              after the value, a semicolon, and your comment, like this:
  7688.  
  7689.                   Environment = 2048       ;set standard environment size
  7690.  
  7691.              If you try to place a comment at the end of a string value,
  7692.              the comment will become part of the string and will probably
  7693.              cause an error.
  7694.  
  7695.              When the command processor detects an error while processing
  7696.              the .INI file, it displays an error message and prompts you to
  7697.              press a key to continue processing the file.  This allows you
  7698.              to note any errors before the startup process continues.  The
  7699.              directive in error will retain its previous or default value.
  7700.              Only the most catastrophic errors (like a disk read failure)
  7701.              will terminate processing of the remainder of the .INI file.
  7702.              If you don't want a pause after each error, use a
  7703.              "PauseOnError = No" directive at the beginning of the .INI
  7704.              file.
  7705.  
  7706.              If you need to test different values for an .INI directive
  7707.              without repeatedly editing the .INI file, see the INIQuery
  7708.              directive on page 133.
  7709.  
  7710.              The .INI file has three sections:  the first or global
  7711.              section, the [Primary] section, and the [Secondary] section.
  7712.              The global section consists of directives at the beginning of
  7713.              the file, with no section name before them.  These directives
  7714.              are effective in all shells.  In most cases, this is the only
  7715.              section you will need, particularly for 4OS2 and 4DOS/NT.
  7716.  
  7717.              The [Primary] and [Secondary] sections include directives that
  7718.              are used only in primary and secondary shells respectively
  7719.              (see page 12 for more information on primary and secondary
  7720.              shells).  Each section is identified by the section name in
  7721.              square brackets on a line by itself.  You don't need to set up
  7722.              these sections unless you want different directives for
  7723.              primary and secondary shells.
  7724.  
  7725.              Directives in the [Primary] section are used for the first or
  7726.              primary shell.  The values are passed automatically to all
  7727.              secondary shells, unless overridden by a directive with the
  7728.              same name in the [Secondary] section.
  7729.  
  7730.              Directives in the [Secondary] section are used in secondary
  7731.              shells only, and override any corresponding primary shell
  7732.              settings.  For example, these lines in the .INI file:
  7733.  
  7734.  
  7735.         -------------------------------------------------------------------
  7736.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 128
  7737.                                                   CHAPTER 5 / CONFIGURATION
  7738.         -------------------------------------------------------------------
  7739.  
  7740.  
  7741.                        [Primary]
  7742.                        ScreenRows = 25
  7743.                        [Secondary]
  7744.                        ScreenRows = 50
  7745.  
  7746.              mean to assume that you have 25 rows on the screen in the
  7747.              primary shell and 50 lines in all secondary shells.
  7748.  
  7749.              Sections that begin with any name other than [Primary] or
  7750.              [Secondary] are ignored.
  7751.  
  7752.              The SETDOS command can override several of the .INI file
  7753.              directives (see page 322).  For example, the cursor shape used
  7754.              by 4DOS, 4OS2, and 4DOS/NT can be adjusted either with the
  7755.              CursorIns and CursorOver directives or the SETDOS /S command.
  7756.              The correspondence between SETDOS options and .INI directives
  7757.              is noted under each directive below, and under each option of
  7758.              the SETDOS command.
  7759.  
  7760.              Secondary shells automatically inherit the configuration
  7761.              settings currently in effect in the previous shell.  If values
  7762.              have been changed by SETDOS since the primary shell started,
  7763.              the current values will be passed to the secondary shell.  If
  7764.              the previous shell's .INI file had a [Secondary] section, it
  7765.              will then be read and processed.  If not, the previous shell's
  7766.              settings will remain in effect.
  7767.  
  7768.              For example, you might set BatchEcho to Yes in the .INI file,
  7769.              to enable batch file echo.  If you then use SETDOS /V0 to turn
  7770.              off batch file echoing in the primary shell, then any
  7771.              secondary shells will inherit the SETDOS setting, rather than
  7772.              the original value from the .INI file; i.e., batch files in
  7773.              the secondary shell will default to no echo.
  7774.  
  7775.              If you want to force secondary shells to start with a specific
  7776.              value for a particular directive, regardless of any changes
  7777.              made with SETDOS in a previous shell, repeat the directive in
  7778.              the [Secondary] section of the .INI file.
  7779.  
  7780.     4DOS     If you start a secondary shell from a task switching program
  7781.              like Windows, DESQview, or Back & Forth, you can specify an
  7782.              alternate location and name for 4DOS.INI by passing the
  7783.              "@d:\path\inifile" option to 4DOS as a command-line parameter
  7784.              (see your 4DOS Introduction and Installation Guide for
  7785.              details).  In this case, the configuration settings in the
  7786.              alternate 4DOS.INI file will supersede any settings inherited
  7787.              from the previous shell.  Any values which are not explicitly
  7788.              set in the alternate file will retain the value they had in
  7789.              the previous shell.
  7790.  
  7791.  
  7792.         -------------------------------------------------------------------
  7793.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 129
  7794.                                                   CHAPTER 5 / CONFIGURATION
  7795.         -------------------------------------------------------------------
  7796.  
  7797.  
  7798.              The first section below lists the different types of
  7799.              directives.  Subsequent sections list all the individual
  7800.              directives, divided by function and then alphabetically by
  7801.              directive name.  At the end we have included a few examples of
  7802.              how to use the .INI file directives (see page 151).
  7803.  
  7804.  
  7805.              Types of Directives
  7806.  
  7807.              There are 8 types of directives in the .INI file.  The
  7808.              different types of directives are shown in the lists below as
  7809.              follows:
  7810.  
  7811.                   * Name = nnnn (1234):  This directive takes a numeric
  7812.                     value which replaces the "nnnn."  The default value is
  7813.                     shown in parentheses.
  7814.  
  7815.                   * Name = c (X):  This directive accepts a single
  7816.                     character as its value.  The default character is
  7817.                     shown in parentheses.  You must type in the actual
  7818.                     character; you cannot use a key name.
  7819.  
  7820.                   * Name = CHOICE1 | Choice2 | ... :  This directive takes
  7821.                     a choice value.  The possible choices are listed,
  7822.                     separated by vertical bars.  The default value is
  7823.                     shown in all upper case letters in the directive
  7824.                     description, but in your file any of the choices can
  7825.                     be entered in upper case or lower case.  For example,
  7826.                     if the choices were shown as "YES | No" then "YES" is
  7827.                     the default.
  7828.  
  7829.                   * Name = Color:  This directive takes a color
  7830.                     specification.  See page 26 for the format of color
  7831.                     names.
  7832.  
  7833.                   * Name = Key (Default):  This directive takes a key
  7834.                     specification.  See page 31 for the format of key
  7835.                     names.
  7836.  
  7837.                   * Name = Path:  This directive takes a path
  7838.                     specification, but not a filename.  The value should
  7839.                     include both a drive and path (e.g., C:\4DOS) to avoid
  7840.                     any possible ambiguities.  A trailing backslash [\] at
  7841.                     the end of the path name is acceptable but not
  7842.                     required.  Any default path is described in the text.
  7843.  
  7844.                   * Name = File:  This directive takes a filename.  We
  7845.                     recommend that you use a full filename including the
  7846.                     drive letter and path to avoid any possible
  7847.  
  7848.  
  7849.         -------------------------------------------------------------------
  7850.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 130
  7851.                                                   CHAPTER 5 / CONFIGURATION
  7852.         -------------------------------------------------------------------
  7853.  
  7854.  
  7855.                     ambiguities.  Any default filename is described in the
  7856.                     text.
  7857.  
  7858.                   * Name = String:  This directive takes a string in the
  7859.                     format shown.  The text describes the default value
  7860.                     and any additional requirements for formatting the
  7861.                     string correctly.  No comments are allowed.
  7862.  
  7863.              4DOS, 4OS2, and 4DOS/NT each contain a fixed-length area for
  7864.              storing strings entered in the .INI file, including file
  7865.              names, paths, and other strings.  This area is large and is
  7866.              unlikely to overflow; if it does, you will receive an error
  7867.              message.  If this occurs, reduce the complexity of your .INI
  7868.              file or contact our technical support department for
  7869.              assistance.
  7870.  
  7871.              Each directive is listed below with its name, type, and
  7872.              default value.  In some cases, no default is shown because the
  7873.              default value is different for different products; in these
  7874.              cases, the default is described in the text.
  7875.  
  7876.  
  7877.              Initialization Directives
  7878.  
  7879.              The directives in this section control how your command
  7880.              processor starts and where it looks for its files.
  7881.  
  7882.                   4StartPath = Path:  Sets the drive and directory where
  7883.                   the 4START and 4EXIT batch files (if any) are located.
  7884.  
  7885.     4DOS          Alias = nnnn  (1024):  Sets the amount of memory in bytes
  7886.                   allocated for the alias list.  The allowable range of
  7887.                   values is 256 to 32767 bytes.  This directive is not
  7888.                   needed in 4OS2 or 4DOS/NT because both adjust the size of
  7889.                   the alias list dynamically.  If you use a global alias
  7890.                   list (see page 169), the Alias value is ignored in all
  7891.                   shells except the shell which first establishes the
  7892.                   global list.
  7893.  
  7894.     4DOS          AutoExecPath = Path | File:  Sets the path used to find
  7895.                   AUTOEXEC.BAT if 4DOS is started as a primary shell with
  7896.                   the /P option in CONFIG.SYS (see your Introduction and
  7897.                   Installation Guide).  If you include only a path, 4DOS
  7898.                   will look for AUTOEXEC.BAT in the specified directory.
  7899.                   If you include a complete file name, 4DOS will look for
  7900.                   the specified file, and will not look for AUTOEXEC.BAT.
  7901.                   The default is the file AUTOEXEC.BAT in the root
  7902.                   directory of the boot drive.
  7903.  
  7904.  
  7905.  
  7906.         -------------------------------------------------------------------
  7907.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 131
  7908.                                                   CHAPTER 5 / CONFIGURATION
  7909.         -------------------------------------------------------------------
  7910.  
  7911.  
  7912.                   Using AutoExecPath with a complete file name lets you
  7913.                   store multiple startup files in a single directory.  You
  7914.                   may find this useful under DOS if you have multiple boot
  7915.                   software and use different startup files under different
  7916.                   configurations, or under OS/2 if you have several DOS
  7917.                   sessions with different startup files.  If you are
  7918.                   running under OS/2, using AutoExecPath is equivalent to
  7919.                   setting DOS_AUTOEXEC on a session's DOS settings notebook
  7920.                   page (see the OS/2 documentation and your Introduction
  7921.                   and Installation Guide for details on DOS settings).
  7922.  
  7923.     4DOS          AutoExecParms = String:  Sets the parameter or parameters
  7924.                   to be passed to AUTOEXEC.BAT, or the file specified with
  7925.                   the AutoExecPath directive, above, when 4DOS is started
  7926.                   as a primary shell with the /P option in CONFIG.SYS (see
  7927.                   your Introduction and Installation Guide).  The
  7928.                   parameters will be available in your AUTOEXEC.BAT file as
  7929.                   %1, %2, etc.
  7930.  
  7931.                   DirHistory = nnnn (256): Sets the amount of memory
  7932.                   allocated to the directory history in bytes.  The
  7933.                   allowable range of values is 128 to 2048 bytes.  If you
  7934.                   use a global directory history list (see page 45), the
  7935.                   DirHistory value is ignored in all shells except the
  7936.                   shell which first establishes the global list.
  7937.  
  7938.     4DOS          Environment = nnnn  (512):  Sets the amount of memory
  7939.                   allocated to the environment in bytes.  The allowable
  7940.                   range of values is 256 to 32767 bytes.  This directive is
  7941.                   not needed in 4OS2 or 4DOS/NT because both adjust the
  7942.                   size of the environment dynamically.
  7943.  
  7944.     4DOS          EnvFree = nnnn  (128):  Sets the minimum amount of memory
  7945.                   in bytes that will be available in the environment for
  7946.                   secondary shells.  4DOS will enlarge the environment for
  7947.                   each secondary shell, if necessary, so that there is at
  7948.                   least this much free environment space when the shell
  7949.                   starts.  The allowable range of values is 128 to 32767
  7950.                   bytes.
  7951.  
  7952.     4OS2          HelpBook = String:  Sets the names of the "books" to be
  7953.                   loaded when 4OS2 help is invoked with the HELP command or
  7954.                   the F1 key.  The default is 4OS2+CMDREF which loads the
  7955.                   4OS2 help and the OS/2 command reference.  See the 4OS2
  7956.                   Introduction and Installation Guide for details about
  7957.                   this directive.
  7958.  
  7959.     4DOS          HelpOptions = String:  Sets default options for the 4DOS
  7960.                   help system.  For the available options, see your 4DOS
  7961.                   Introduction and Installation Guide.
  7962.  
  7963.         -------------------------------------------------------------------
  7964.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 132
  7965.                                                   CHAPTER 5 / CONFIGURATION
  7966.         -------------------------------------------------------------------
  7967.  
  7968.  
  7969.     4DOS          HelpPath = Path:  Sets the path used to find 4HELP.EXE
  7970.                   when F1 is pressed or the HELP command is used.  If this
  7971.                   directive is not used, 4DOS will search the current
  7972.                   directory and each of the directories in the PATH.
  7973.  
  7974.                   History = nnnn  (1024):  Sets the amount of memory
  7975.                   allocated to the command history list in bytes.  The
  7976.                   allowable range of values is 256 to 8192 bytes.  If you
  7977.                   use a global history list (see page 39), the History
  7978.                   value is ignored in all shells except the shell which
  7979.                   first establishes the global list.
  7980.  
  7981.                   INIQuery = Yes | NO:  If set to Yes, a prompt will be
  7982.                   displayed before execution of each subsequent line in the
  7983.                   current .INI file.  This allows you to modify certain
  7984.                   directives when you start the command processor in order
  7985.                   to test different configurations.  INIQuery can be reset
  7986.                   to No at any point in the file.  Normally INIQuery = Yes
  7987.                   is only used during testing of other .INI file
  7988.                   directives.
  7989.  
  7990.                   The prompt generated by INIQuery = Yes is:
  7991.  
  7992.                        [contents of the line]  (Y/N/Q/R/E)  ?
  7993.  
  7994.                   At this prompt, you may enter:
  7995.  
  7996.                        Y = Yes:  Process this line and go on to the next.
  7997.                        N = No:   Skip this line and go on to the next.
  7998.                        Q = Quit: Skip this line and all subsequent lines.
  7999.                        R = Rest: Execute this and all subsequent lines.
  8000.                        E = Edit: Prompt for a new value for this entry.
  8001.  
  8002.                   If you choose E for Edit, you can enter a new value for
  8003.                   the directive, but not a new directive name.
  8004.  
  8005.                   For example, if you have found a compatibility problem
  8006.                   you think may be related to 4DOS's swapping or upper
  8007.                   memory block usage, you might change your 4DOS.INI file
  8008.                   so a part of it read as follows:
  8009.  
  8010.                        INIQuery = Yes
  8011.                        Swapping = XMS, EMS, C:\
  8012.                        UMBLoad = Yes
  8013.                        UMBEnvironment = Yes
  8014.                        INIQuery = No
  8015.  
  8016.                   You could then choose to process, ignore, or edit the
  8017.                   Swapping,  UMBLoad, or UMBEnvironment directive each time
  8018.                   4DOS started.  This would allow you to test several
  8019.  
  8020.         -------------------------------------------------------------------
  8021.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 133
  8022.                                                   CHAPTER 5 / CONFIGURATION
  8023.         -------------------------------------------------------------------
  8024.  
  8025.  
  8026.                   possible combinations to see if you could resolve the
  8027.                   compatibility problem.
  8028.  
  8029.                   LocalAliases = Yes | No:  The default value is Yes in
  8030.                   4DOS and No in 4OS2 and 4DOS/NT.  No forces all copies of
  8031.                   the command processor to share the same alias list.  Yes
  8032.                   keeps the lists for each shell separate.  See page 169
  8033.                   for more details on local and global alias lists.
  8034.  
  8035.                   LocalDirHistory = Yes | No:  The default value is Yes in
  8036.                   4DOS and No in 4OS2 and 4DOS/NT.  No forces all copies of
  8037.                   the command processor to share the same directory
  8038.                   history.  Yes keeps the directory histories for each
  8039.                   shell separate.  See page 45 for more details on local
  8040.                   and global directory histories.
  8041.  
  8042.                   LocalHistory = Yes | No:  The default value is Yes in
  8043.                   4DOS and No in 4OS2 and 4DOS/NT.  No forces all copies of
  8044.                   the command processor to share the same history list.
  8045.                   Yes keeps the lists for each shell separate.  See page 39
  8046.                   for more details on local and global history lists.
  8047.  
  8048.                   PauseOnError = YES | No:  Yes forces a pause with the
  8049.                   message "Error in filename, press any key to continue
  8050.                   processing" after displaying any error message related to
  8051.                   a specific line in the .INI file.  No continues
  8052.                   processing with no pause after an error message is
  8053.                   displayed.
  8054.  
  8055.     4DOS          Swapping = swap type [, swap type] ...:  Sets the type of
  8056.                   swapping 4DOS should use.  4DOS runs in two parts, a
  8057.                   resident portion that is always in memory and a transient
  8058.                   portion that is "swapped" to EMS memory, XMS memory, a
  8059.                   RAM disk, or your hard disk while application programs
  8060.                   are running.  The swap area for the transient portion
  8061.                   normally requires about 128K bytes of memory or disk
  8062.                   space for the primary shell, and 28 - 32K bytes for each
  8063.                   secondary shell.
  8064.  
  8065.                   The swap type can be EMS to swap to EMS expanded memory,
  8066.                   XMS to swap to XMS extended memory, d:\path to swap to
  8067.                   the specified drive and path, or None for no swapping.
  8068.  
  8069.                   If you use d:\path, 4DOS will create the file
  8070.                   4DOSSWAP.nnn in the specified directory.  The file name
  8071.                   changes if UniqueSwapName is set to Yes (see page 151).
  8072.                   If you use None, the transient portion of 4DOS will
  8073.                   remain in memory at all times; this will reduce memory
  8074.                   available for application programs by about 128K.
  8075.  
  8076.  
  8077.         -------------------------------------------------------------------
  8078.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 134
  8079.                                                   CHAPTER 5 / CONFIGURATION
  8080.         -------------------------------------------------------------------
  8081.  
  8082.  
  8083.                   You can specify multiple swap types and 4DOS will try
  8084.                   them in the order listed.  Swap type "None" is always
  8085.                   appended to your list of possible swap types as a "last
  8086.                   resort," even if you don't include it explicitly.  The
  8087.                   default Swapping specification is EMS, XMS, x:\, None,
  8088.                   where x is the boot drive.  In most cases you will find
  8089.                   that the default setting works without modification.
  8090.  
  8091.                   Before changing the Swapping specification, see your 4DOS
  8092.                   Introduction and Installation Guide for more detail on
  8093.                   swapping types and the way 4DOS uses memory.
  8094.  
  8095.     4DOS          UMBAlias = Yes | NO | 1 | 2 ... | 8:  Yes attempts to
  8096.                   load global alias list storage into a UMB (Upper Memory
  8097.                   Block).  If you use a specific region number (1 through
  8098.                   8), 4DOS will attempt to reserve room for the global
  8099.                   alias list in that UMB region.
  8100.  
  8101.                   Region numbers can be used under MS-DOS / PC-DOS 5.0 and
  8102.                   above, and under OS/2's DOS support.  To use them, you
  8103.                   must enable DOS UMB management with the DOS=UMB or
  8104.                   DOS=HIGH,UMB directive in CONFIG.SYS.  See your 4DOS
  8105.                   Introduction and Installation Guide for complete details
  8106.                   on UMBs and UMB regions, and the hardware and software
  8107.                   required to support them.
  8108.  
  8109.                   If you use an invalid region number, or if region numbers
  8110.                   have not been enabled on your system, 4DOS will load the
  8111.                   global alias list into the first available region.  If no
  8112.                   upper memory is available, space for the global alias
  8113.                   list will be reserved in low memory.
  8114.  
  8115.                   UMBAlias applies to global aliases only, and is only used
  8116.                   in the first shell which establishes the global alias
  8117.                   area (see page 169 for more information on local and
  8118.                   global alias lists).  If you specify LocalAliases = Yes,
  8119.                   or if the previous shell already created a global alias
  8120.                   area, any UMBAlias setting is ignored.
  8121.  
  8122.     4DOS          UMBDirHistory= Yes | NO | 1 | 2 ... | 8:  Yes attempts to
  8123.                   load global directory history list storage into a UMB
  8124.                   (Upper Memory Block).  If you use a specific region
  8125.                   number (1 through 8), 4DOS will attempt to reserve room
  8126.                   for the global directory history list in that UMB region.
  8127.                   See page 45 for more information on local and global
  8128.                   directory history lists.  See UMBAlias (above) for
  8129.                   information on the use of UMBs and region numbers.  Like
  8130.                   UMBAlias, UMBDirHistory will be ignored if a global
  8131.                   directory history list is not used.
  8132.  
  8133.  
  8134.         -------------------------------------------------------------------
  8135.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 135
  8136.                                                   CHAPTER 5 / CONFIGURATION
  8137.         -------------------------------------------------------------------
  8138.  
  8139.  
  8140.     4DOS          UMBEnvironment = Yes | NO | 1 | 2 ... | 8:  Yes attempts
  8141.                   to load the master environment into a UMB (Upper Memory
  8142.                   Block).  This reduces 4DOS's base memory requirements but
  8143.                   may cause problems with some programs that try to access
  8144.                   the master environment directly.  See UMBAlias (above)
  8145.                   for information on the use of UMBs and region numbers.
  8146.  
  8147.     4DOS          UMBHistory = Yes | NO | 1 | 2 ... | 8:  Yes attempts to
  8148.                   load global history list storage into a UMB (Upper Memory
  8149.                   Block).  If you use a specific region number (1 through
  8150.                   8), 4DOS will attempt to reserve room for the global
  8151.                   history list in that UMB region.  See page 39 for more
  8152.                   information on local and global history lists.  See
  8153.                   UMBAlias (above) for information on the use of UMBs and
  8154.                   region numbers.  Like UMBAlias, UMBHistory will be
  8155.                   ignored if a global history list is not used.
  8156.  
  8157.     4DOS          UMBLoad = Yes | NO | 1 | 2 ... | 8:  Yes attempts to load
  8158.                   the resident portion of 4DOS into a UMB (Upper Memory
  8159.                   Block).  This reduces the size of the resident portion in
  8160.                   base memory from about 3K bytes to 256 bytes.  See
  8161.                   UMBAlias (above) for information on the use of UMBs and
  8162.                   region numbers.
  8163.  
  8164.     4OS2,         WindowState = STANDARD | Maximize | Minimize:  Sets the
  8165.     4NT           initial state of the 4OS2 or 4DOS/NT window.  Standard
  8166.                   puts the window in the default position on the OS/2 or
  8167.                   Windows NT desktop, and is the default setting.  Maximize
  8168.                   maximizes the window; Minimize minimizes it.  If you use
  8169.                   Maximize or Minimize, you may see the 4OS2 or 4DOS/NT
  8170.                   window appear briefly in the Standard position as it is
  8171.                   created by the operating system, then switch to the new
  8172.                   state.
  8173.  
  8174.     4OS2,         WindowX = nnnn, WindowY = nnnn, WindowWidth = nnnn,
  8175.     4NT           WindowHeight = nnnn:  These 4 directives set the initial
  8176.                   size and position of the 4OS2 or 4DOS/NT window.  The
  8177.                   measurements are in pixels or pels.  Under 4OS2, WindowX
  8178.                   and WindowY refer to the position of the bottom left
  8179.                   corner of the window relative to the bottom left corner
  8180.                   of the screen.  Under 4DOS/NT, WindowX and WindowY refer
  8181.                   to the position of the top left corner of the window
  8182.                   relative to the top left corner of the screen.
  8183.  
  8184.  
  8185.              Configuration Directives
  8186.  
  8187.              These directives control the way that 4DOS, 4OS2, and 4DOS/NT
  8188.              operate.  Some can be changed with the SETDOS command while
  8189.              the command processor is running.  Any corresponding SETDOS
  8190.  
  8191.         -------------------------------------------------------------------
  8192.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 136
  8193.                                                   CHAPTER 5 / CONFIGURATION
  8194.         -------------------------------------------------------------------
  8195.  
  8196.  
  8197.              command is listed in the description of each directive;
  8198.              information on SETDOS begins on page 322.
  8199.  
  8200.                   AmPm = Yes | NO | Auto:  Yes displays times in 12-hour
  8201.                   format with a trailing "a" for AM or "p" for PM.  The
  8202.                   default of No forces a display in 24-hour time format.
  8203.                   Auto formats the time according to the country code set
  8204.                   for your system.  AmPm controls the time displays used by
  8205.                   DIR and SELECT, in LOG files, and the output of the
  8206.                   TIMER, DATE, and TIME commands.  It has no effect on
  8207.                   %_TIME, %@MAKETIME, the $t and $T options of PROMPT, or
  8208.                   date and time ranges.
  8209.  
  8210.     4DOS          ANSI = AUTO | Yes | No:  Tells 4DOS whether an ANSI
  8211.                   driver is installed and should be used for the CLS and
  8212.                   COLOR commands.  4DOS normally determines this itself,
  8213.                   but if you are using a non-standard ANSI driver or your
  8214.                   loading sequence is unusual, you may need to explicitly
  8215.                   inform 4DOS.  Also see SETDOS /A.  This directive is not
  8216.                   available in 4OS2 (because 4OS2 assumes that ANSI support
  8217.                   is always enabled), or 4DOS/NT (because Windows NT does
  8218.                   not offer ANSI support).
  8219.  
  8220.                   BatchEcho = YES | No:  Sets the default batch ECHO mode.
  8221.                   Yes enables echoing of all batch file commands unless
  8222.                   ECHO is explicitly set off in the batch file.  No
  8223.                   disables batch file echoing unless ECHO is explicitly set
  8224.                   on.  Also see SETDOS /V.
  8225.  
  8226.                   BeepFreq = nnnn  (440):  Sets the default BEEP command
  8227.                   frequency in Hz.  This is also the frequency for "error"
  8228.                   beeps (for example, if you press an illegal key).  To
  8229.                   disable all error beeps set this or BeepLength to 0.  If
  8230.                   you do, the BEEP command will still be operable, but will
  8231.                   not produce sound unless you explicitly specify the
  8232.                   frequency and duration.
  8233.  
  8234.                   BeepLength = nnnn  (2):  Sets the default BEEP length in
  8235.                   system clock ticks (approximately 1/18 of a second per
  8236.                   tick).  BeepLength is also the default length for "error"
  8237.                   beeps (for example, if you press an illegal key).
  8238.  
  8239.                   CommandSep = c:  This is the character used to separate
  8240.                   multiple commands on the same line.  The default is the
  8241.                   caret [^] in 4DOS, and the ampersand [&] in 4OS2 and
  8242.                   4DOS/NT.  You cannot use any of the redirection
  8243.                   characters (| > < ) or any of the whitespace characters
  8244.                   (space, tab, comma, or equal sign).  Also see SETDOS /C,
  8245.                   the %+ internal variable on page 74, and page 102 for
  8246.  
  8247.  
  8248.         -------------------------------------------------------------------
  8249.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 137
  8250.                                                   CHAPTER 5 / CONFIGURATION
  8251.         -------------------------------------------------------------------
  8252.  
  8253.  
  8254.                   information on using compatible command separators for
  8255.                   two or more products.
  8256.  
  8257.                   CursorIns = nnnn  (100):  This is the shape of the cursor
  8258.                   for insert mode during command-line editing and all
  8259.                   commands which accept line input (DESCRIBE, ESET, etc.).
  8260.                   The size is a percentage of the total character cell
  8261.                   size, between 0% and 100%.  Because of the way video
  8262.                   BIOSes and drivers map the cursor shape, you may not get
  8263.                   a smooth progression in cursor shapes as CursorIns and
  8264.                   CursorOver change.  If CursorIns or CursorOver is set to
  8265.                   -1, the command processor will not attempt to modify the
  8266.                   cursor shape at all; you can use this feature to give
  8267.                   another program full control of the cursor shape.  Also
  8268.                   see SETDOS /S.
  8269.  
  8270.                   CursorOver = nnnn  (15):  This is the shape of the cursor
  8271.                   for overtype mode during command-line editing and all
  8272.                   commands which accept line input.  The size is a
  8273.                   percentage of the total character cell size, between 0%
  8274.                   and 100%.  Also see SETDOS /S.
  8275.  
  8276.                   DescriptionMax = nnnn (40):  Controls the description
  8277.                   length limit for DESCRIBE (see page 201).  The allowable
  8278.                   range is 20 to 512 characters.
  8279.  
  8280.                   Descriptions = YES | No:  Turns description handling on
  8281.                   or off during the file processing commands COPY, DEL,
  8282.                   MOVE, and REN.  If set to No, the command processor will
  8283.                   not update the description file when files are moved,
  8284.                   copied, deleted or renamed.  Also see SETDOS /D.
  8285.  
  8286.                   EditMode = Insert | OVERSTRIKE:  This directive lets you
  8287.                   start the command-line editor in either insert or
  8288.                   overstrike mode.  Also see SETDOS /M.
  8289.  
  8290.                   EscapeChar = c :  Sets the character used to suppress the
  8291.                   normal meaning of the following character.  The default
  8292.                   is  Ctrl-X in 4DOS, and a caret [^] in 4OS2 and 4DOS/NT.
  8293.                   See page 73 for a description of the escape character and
  8294.                   special escape sequences.  You cannot use any of the
  8295.                   redirection characters (|, >, or < ) or the whitespace
  8296.                   characters (space, tab, comma, or equal sign) as the
  8297.                   escape character.  Also see SETDOS /E, the %= internal
  8298.                   variable on page 102, and page 74 for information on
  8299.                   using compatible escape characters for two or more
  8300.                   products.
  8301.  
  8302.                   EvalMax = nnnn (8):  Controls the maximum number of
  8303.                   digits after the decimal point in values returned by
  8304.  
  8305.         -------------------------------------------------------------------
  8306.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 138
  8307.                                                   CHAPTER 5 / CONFIGURATION
  8308.         -------------------------------------------------------------------
  8309.  
  8310.  
  8311.                   @EVAL (see page 112).  This setting can be overridden
  8312.                   with the construct @EVAL[expression=n.n].  The allowable
  8313.                   range is 0 to 8.  Also see SETDOS /F.
  8314.  
  8315.                   EvalMin = nnnn (0):  Controls the minimum number of
  8316.                   digits after the decimal point in values returned by
  8317.                   @EVAL (see page 112).  The allowable range is 0 to 8.
  8318.                   EvalMin will be ignored if it is larger than EvalMax.
  8319.                   This setting can be overridden with the construct
  8320.                   @EVAL[expression=n.n].  Also see SETDOS /F.
  8321.  
  8322.                   HistCopy = Yes | NO:  Controls what happens when you re-
  8323.                   execute a line from the command history.  If this option
  8324.                   is set to Yes, the line is appended to the end of the
  8325.                   history list.  By default, or if this option is set to
  8326.                   No, no copy of the command is made.  The original copy of
  8327.                   the command is always retained at its original position
  8328.                   in the list, regardless of the setting of HistCopy.
  8329.  
  8330.                   HistLogName = File:  Sets the history log file name
  8331.                   and/or path.  If only a path is given, the default log
  8332.                   file name (4DOSHLOG, 4OS2HLOG, etc.) will be used.  Using
  8333.                   HistLogName does not turn history logging on; you must
  8334.                   use a LOG /H ON command to do so.
  8335.  
  8336.                   HistMin = nnnn  (0):  Sets the minimum command-line size
  8337.                   to save in the command history list.  Any command line
  8338.                   whose length is less than this value will not be saved.
  8339.                   Legal values range from 0, which saves everything, to the
  8340.                   maximum command-line length plus 1 (i.e., 256 in 4DOS, or
  8341.                   1024 in 4OS2 and 4DOS/NT), which disables all command
  8342.                   history saves.
  8343.  
  8344.                   HistWinColors = Color:  Sets the default colors for the
  8345.                   command-line and directory history windows.  If this
  8346.                   directive is not used the colors will be reversed from
  8347.                   the current colors on the screen.
  8348.  
  8349.                   HistWinHeight = nn (12):  Sets the height of the command-
  8350.                   line and directory history windows in lines, including
  8351.                   the border.  Legal values range from 5 to the height of
  8352.                   your screen.  Any value which would cause the bottom of
  8353.                   the window to be off the screen will be adjusted so that
  8354.                   the entire window remains on the screen.
  8355.  
  8356.                   HistWinLeft = nn (40):  Sets the horizontal position of
  8357.                   the left side of the command-line and directory history
  8358.                   windows.  Legal values range from 0 (the left edge of the
  8359.                   screen) to the number of columns on your screen minus 10.
  8360.                   Any value which would cause the right side of a minimum-
  8361.  
  8362.         -------------------------------------------------------------------
  8363.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 139
  8364.                                                   CHAPTER 5 / CONFIGURATION
  8365.         -------------------------------------------------------------------
  8366.  
  8367.  
  8368.                   width window to be off the screen will be adjusted so
  8369.                   that the entire window remains on the screen.
  8370.  
  8371.                   HistWinTop = nn (1):  Sets the vertical position of the
  8372.                   top of the command-line and directory history windows.
  8373.                   Legal values range from 0 (the top of the screen) to the
  8374.                   number of rows on your screen minus 5.  Any value which
  8375.                   would cause the bottom of a minimum-height window to be
  8376.                   off the screen will be adjusted so that the entire window
  8377.                   remains on the screen.
  8378.  
  8379.                   HistWinWidth = nn (36):  Sets the width of the command-
  8380.                   line and directory history windows in characters,
  8381.                   including the border.  Legal values range from 10 to the
  8382.                   width of your screen.  Any value which would cause the
  8383.                   right side of the window to be off the screen will be
  8384.                   adjusted so that the entire window remains on the screen.
  8385.  
  8386.     4DOS,         LineInput = Yes | NO:  This directive controls how 4DOS
  8387.     4OS2          and 4OS2 get their input from the command line.  Yes
  8388.                   forces 4DOS and 4OS2 to perform line-by-line input, just
  8389.                   as COMMAND.COM and CMD.EXE do, instead of character-by-
  8390.                   character input.  This will disable command-line editing,
  8391.                   history recall, the directory history window, and
  8392.                   filename completion, and will reduce the 4OS2 input
  8393.                   length limit from 1023 characters to 255 characters.  It
  8394.                   is normally used only for rare memory-resident programs
  8395.                   (TSRs) or applications which do not work properly unless
  8396.                   the command processor uses line input.  If you have a
  8397.                   particular program that requires line input, you can use
  8398.                   SETDOS /L to temporarily change modes.  See APPNOTES.DOC
  8399.                   (for 4DOS) or README.DOC (for 4OS2) for information on
  8400.                   programs which require this option.
  8401.  
  8402.                   LogName = File:  Sets the log file name and/or path. If
  8403.                   only a path is given, the default log file name (4DOSLOG,
  8404.                   4OS2LOG, etc.) will be used.  Using LogName does not turn
  8405.                   logging on; you must use a LOG ON command to do so.
  8406.  
  8407.                   NoClobber = Yes | NO:  If set to Yes, will prevent
  8408.                   standard output redirection (see page 52) from
  8409.                   overwriting an existing file, and will require that the
  8410.                   output file already exist for append redirection.  Also
  8411.                   see SETDOS /N.
  8412.  
  8413.                   ParameterChar= c:  Sets the character used after a
  8414.                   percent sign to specify all or all remaining command-line
  8415.                   arguments in a batch file or alias (e.g., %& or %n&; see
  8416.                   pages 82 and 168).  The default is the ampersand [&] for
  8417.                   4DOS and the dollar sign [$] for 4OS2 and 4DOS/NT.  Also
  8418.  
  8419.         -------------------------------------------------------------------
  8420.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 140
  8421.                                                   CHAPTER 5 / CONFIGURATION
  8422.         -------------------------------------------------------------------
  8423.  
  8424.  
  8425.                   see SETDOS /P.  See page 74 for information on using
  8426.                   compatible parameter characters for two or more
  8427.                   products..
  8428.  
  8429.                   Printer = devicename:  Sets the output device that the
  8430.                   LIST command will print to.  By default, LPT1 is used.
  8431.                   The device can be PRN, LPT1 to 3, COM1 to 4, NUL (which
  8432.                   will disable printed output) or any other installed
  8433.                   character device.
  8434.  
  8435.     4DOS          ScreenColumns = nnnn:  Sets the number of columns used by
  8436.                   the video display.  Normally the screen size is
  8437.                   determined automatically, but if you have a non-standard
  8438.                   display you may need to set it explicitly.  Systems which
  8439.                   need to set OutputBIOS to Yes (see page 150) may also
  8440.                   need to use this directive.
  8441.  
  8442.                   ScreenRows = nnnn:  Sets the number of screen rows used
  8443.                   by the video display.  Normally the screen size is
  8444.                   determined automatically, but if you have a non-standard
  8445.                   display you may need to set it explicitly.  This value
  8446.                   does not affect screen scrolling, which is controlled by
  8447.                   your operating system, or (under DOS) your video BIOS or
  8448.                   ANSI driver.  ScreenRows is used only by the LIST and
  8449.                   SELECT commands, the paged output options of other
  8450.                   commands (e.g., TYPE /P), and error checking in the
  8451.                   screen output commands.  Also see SETDOS /R.
  8452.  
  8453.                   UpperCase = Yes | NO:  Yes specifies that file and
  8454.                   directory names should be displayed in the traditional
  8455.                   upper-case by internal commands like COPY and DIR.  No
  8456.                   allows the normal 4DOS, 4OS2, and 4DOS/NT lower-case
  8457.                   style.  This directive does not affect the display of
  8458.                   filenames on HPFS and NTFS drives, or on FAT drives under
  8459.                   Windows NT 3.5 and above; see page 17 for more details.
  8460.                   Also see SETDOS /U.
  8461.  
  8462.  
  8463.              Color Directives
  8464.  
  8465.              These directives control the colors that 4DOS, 4OS2, and
  8466.              4DOS/NT use for their displays.  Screen border colors can only
  8467.              be set in StdColors.  "BORder" color specifications included
  8468.              in other directives will be ignored.  For complete details on
  8469.              color names see page 26.
  8470.  
  8471.     4DOS,         BrightBG = Yes | No.  If set to Yes, 4DOS and 4OS2 will
  8472.     4OS2          enable bright background colors.  If set to No, bright
  8473.                   backgrounds will be disabled but blinking foreground
  8474.                   characters will be enabled.  If BrightBG is not used,
  8475.  
  8476.         -------------------------------------------------------------------
  8477.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 141
  8478.                                                   CHAPTER 5 / CONFIGURATION
  8479.         -------------------------------------------------------------------
  8480.  
  8481.  
  8482.                   4DOS and 4OS2 will not adjust the bright background /
  8483.                   blinking foreground switch at all.  Most color video
  8484.                   boards default to a blinking foreground with bright
  8485.                   background colors disabled.  See also SETDOS /B.
  8486.  
  8487.                   Using BrightBG requires careful attention to interactions
  8488.                   of display type, mode, and color.  For a detailed
  8489.                   explanation, see page 28.
  8490.  
  8491.                   ColorDir = ext1 ext2 ...:colora;ext3 ext4 ... :colorb;
  8492.                   ...:  Sets the directory colors used by DIR and SELECT.
  8493.                   The format is the same as that used for the COLORDIR
  8494.                   environment variable.  See page 30 for a detailed
  8495.                   explanation of color-coded directories.
  8496.  
  8497.                   InputColors = Color:  Sets the colors used for command-
  8498.                   line input.  This setting is useful for making your input
  8499.                   stand out from the normal output.  InputColors will not
  8500.                   work properly under 4DOS unless you have an ANSI driver
  8501.                   loaded (see page 25 for more information on ANSI).
  8502.  
  8503.                   ListColors = Color:  Sets the colors used by the LIST
  8504.                   command.  If this directive is not used, LIST will use
  8505.                   the current default colors set by the CLS or COLOR
  8506.                   command or by the StdColors directive, below.
  8507.  
  8508.                   ListStatBarColors = Color:  Sets the colors used on the
  8509.                   LIST status bar.  If this directive is not used, LIST
  8510.                   will set the status bar to the reverse of the screen
  8511.                   color (the screen color is controlled by ListColors,
  8512.                   above).
  8513.  
  8514.                   SelectColors = Color:  Sets the color used by the SELECT
  8515.                   command.  If this directive is not used, SELECT will use
  8516.                   the current default colors set by the CLS or COLOR
  8517.                   command or by the StdColors directive, below.
  8518.  
  8519.                   SelectStatBarColors = Color:  Sets the color used on the
  8520.                   SELECT status bar.  If this directive is not used, SELECT
  8521.                   will set the status bar to the reverse of the screen
  8522.                   color (the screen color is controlled by SelectColors,
  8523.                   above).
  8524.  
  8525.                   StdColors = Color:  Sets the standard colors to be used
  8526.                   when CLS is used without a color specification, and for
  8527.                   LIST and SELECT if ListColors and SelectColors are not
  8528.                   used.  Using this directive is similar to placing a COLOR
  8529.                   command in AUTOEXEC.BAT.  StdColors takes effect the
  8530.                   first time CLS, LIST, or SELECT is used after 4DOS, 4OS2,
  8531.                   or 4DOS/NT starts, but will not affect the color of error
  8532.  
  8533.         -------------------------------------------------------------------
  8534.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 142
  8535.                                                   CHAPTER 5 / CONFIGURATION
  8536.         -------------------------------------------------------------------
  8537.  
  8538.  
  8539.                   or other messages displayed during the loading and
  8540.                   initialization process.  Under 4DOS, if ANSI.SYS or a
  8541.                   compatible driver is not loaded, the colors will not be
  8542.                   "sticky" - you may lose them when you run an application.
  8543.  
  8544.  
  8545.           ## Key Mapping Directives
  8546.  
  8547.              The directives in this group allow you to change the keys used
  8548.              for command-line editing and other internal functions.  They
  8549.              take effect only inside 4DOS, 4OS2, or 4DOS/NT, and do not
  8550.              affect other programs or the help system.
  8551.  
  8552.              The description of each directive below explains the function
  8553.              of the corresponding key.  Using the directive allows you to
  8554.              assign a different or additional key to perform the function
  8555.              described.  For example, to use function key F3 to invoke the
  8556.              HELP facility (normally invoked with F1):
  8557.  
  8558.                   Help = F3
  8559.  
  8560.              Any directive can be used multiple times to assign multiple
  8561.              keys to the same function.  For example:
  8562.  
  8563.                   ListFind = F        ;F does a find in LIST
  8564.                   ListFind = F5       ;F5 also does a find in LIST
  8565.  
  8566.              Use some care when you reassign keystrokes.  If you assign a
  8567.              default key to a different function, it will no longer be
  8568.              available for its original use.  For example, if you assign F1
  8569.              to the AddFile directive (a part of filename completion), the
  8570.              F1 key will no longer invoke the help system, so you will
  8571.              probably want to assign a different key to Help.
  8572.  
  8573.              Please read the information on key names beginning on page 31
  8574.              before using the key mapping directives.
  8575.  
  8576.              Key assignments are processed before looking for keystroke
  8577.              aliases.  For example, if you assign Shift-F1 to HELP and also
  8578.              assign Shift-F1 to a key alias, the key alias will be ignored.
  8579.  
  8580.              Assigning a new keystroke for a function does not deassign the
  8581.              default keystroke for the same function.  If you want to
  8582.              deassign one of the default keys, use the NormalKey directive
  8583.              described below or the corresponding directive for keys in the
  8584.              other key groups (NormalEditKey, NormalHWinKey, or
  8585.              NormalListKey).
  8586.  
  8587.  
  8588.  
  8589.  
  8590.         -------------------------------------------------------------------
  8591.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 143
  8592.                                                   CHAPTER 5 / CONFIGURATION
  8593.         -------------------------------------------------------------------
  8594.  
  8595.  
  8596.              General Input Keys
  8597.  
  8598.                   This first set of Key Mapping Directives applies to all
  8599.                   input.  These directives are in effect whenever 4DOS,
  8600.                   4OS2, or 4DOS/NT requests input from the keyboard,
  8601.                   including during command-line editing and the DESCRIBE,
  8602.                   ESET, INPUT, LIST, and SELECT commands.  See page 35 for
  8603.                   more information about command-line editing.
  8604.  
  8605.                   Backspace = Key  (Bksp):  Deletes the character to the
  8606.                   left of the cursor.
  8607.  
  8608.                   BeginLine = Key  (Home):  Moves the cursor to the
  8609.                   beginning of the line.
  8610.  
  8611.                   Del = Key  (Del):  Deletes the character at the cursor.
  8612.  
  8613.                   DelToBeginning = Key (Ctrl-Home):  Deletes from the
  8614.                   cursor to the start of the line.
  8615.  
  8616.                   DelToEnd = Key (Ctrl-End):  Deletes from the cursor to
  8617.                   the end of the line.
  8618.  
  8619.                   DelWordLeft = Key  (Ctrl-L):  Deletes the word to the
  8620.                   left of the cursor.
  8621.  
  8622.                   DelWordRight = Key  (Ctrl-R, Ctrl-Bksp):  Deletes the
  8623.                   word to the right of the cursor.  See ClearKeyMap on page
  8624.                   148 if you need to remove the default mapping of Ctrl-
  8625.                   Bksp to this function.
  8626.  
  8627.                   Down = Key  (Down):  Scrolls the display down one line in
  8628.                   LIST; moves the cursor down one line in SELECT and in the
  8629.                   command-line history, directory history, or %@SELECT
  8630.                   window.  (Scrolling down through the command history at
  8631.                   the prompt is controlled by NextHistory on page 145, not
  8632.                   by this directive.)
  8633.  
  8634.                   EndLine = Key  (End):  Moves the cursor to the end of the
  8635.                   line.
  8636.  
  8637.                   EraseLine = Key  (Esc):  Deletes the entire line.
  8638.  
  8639.                   ExecLine = Key (Enter):  Executes or accepts a line.
  8640.  
  8641.                   Ins = Key (Ins):  Toggles insert / overstrike mode during
  8642.                   line editing.
  8643.  
  8644.                   Left = Key  (Left):  Moves the cursor left one character;
  8645.                   scrolls the display left 8 columns in LIST; scrolls the
  8646.  
  8647.         -------------------------------------------------------------------
  8648.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 144
  8649.                                                   CHAPTER 5 / CONFIGURATION
  8650.         -------------------------------------------------------------------
  8651.  
  8652.  
  8653.                   display left 4 columns in the command-line, directory
  8654.                   history, or %@SELECT window.
  8655.  
  8656.                   NormalKey = Key:  Deassigns a general input key in order
  8657.                   to disable the usual meaning of the key within 4DOS,
  8658.                   4OS2, or 4DOS/NT and/or make it available for keystroke
  8659.                   aliases.  This will make the keystroke operate as a
  8660.                   "normal" key with no special function.  For example:
  8661.  
  8662.                        NormalKey = Ctrl-End
  8663.  
  8664.                   will disable Ctrl-End, which is the standard "delete to
  8665.                   end of line" key.  Ctrl-End could then be assigned to a
  8666.                   keystroke alias.  Another key could be assigned the
  8667.                   "delete to end of line" function with the DelToEnd
  8668.                   directive (above).
  8669.  
  8670.                   Right = Key  (Right):  Moves the cursor right one
  8671.                   character; scrolls the display right 8 columns in LIST;
  8672.                   scrolls the display right 4 columns in the command-line
  8673.                   history, directory history, or %@SELECT window.
  8674.  
  8675.                   Up = Key  (Up):  Scrolls the display up one line in LIST;
  8676.                   moves the cursor up one line in SELECT and in the
  8677.                   command-line history, directory history, or %@SELECT
  8678.                   window.  (Scrolling up through the command history at the
  8679.                   prompt is controlled by PrevHistory on page 145, not by
  8680.                   this directive.)
  8681.  
  8682.                   WordLeft = Key  (Ctrl-Left):  Moves the cursor left one
  8683.                   word; scrolls the display left 40 columns in LIST.
  8684.  
  8685.                   WordRight = Key  (Ctrl-Right):  Moves the cursor right
  8686.                   one word; scrolls the display right 40 columns in LIST.
  8687.  
  8688.  
  8689.              Command-Line Editing Keys
  8690.  
  8691.                   The following directives apply only to command-line
  8692.                   editing.  They are only effective at the 4DOS, 4OS2, or
  8693.                   4DOS/NT prompt.
  8694.  
  8695.                   AddFile = Key  (F10):  Keeps the current filename
  8696.                   completion entry and inserts the next matching name.
  8697.  
  8698.                   CommandEscape = Key  (Alt-255):  Allows direct entry of a
  8699.                   keystroke that would normally be interpreted as an editor
  8700.                   command.
  8701.  
  8702.  
  8703.  
  8704.         -------------------------------------------------------------------
  8705.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 145
  8706.                                                   CHAPTER 5 / CONFIGURATION
  8707.         -------------------------------------------------------------------
  8708.  
  8709.  
  8710.                   DelHistory = Key  (Ctrl-D):  Deletes the displayed
  8711.                   history list entry and displays the previous entry.
  8712.  
  8713.                   EndHistory = Key  (Ctrl-E):  Displays the last entry in
  8714.                   the history list.
  8715.  
  8716.                   Help = Key  (F1):  Invokes the HELP facility.
  8717.  
  8718.                   NextFile = Key  (F9, Tab):  Gets the next matching
  8719.                   filename.  See ClearKeyMap on page 148 if you need to
  8720.                   remove the default mapping of Tab to this function.
  8721.  
  8722.                   NextHistory = Key  (Down):  Recalls the next command from
  8723.                   the command history.
  8724.  
  8725.                   NormalEditKey = Key:  Deassigns a command-line editing
  8726.                   key in order to disable the usual meaning of the key
  8727.                   while editing a command line, and/or make it available
  8728.                   for keystroke aliases.  For details see the NormalKey
  8729.                   directive on page 145.
  8730.  
  8731.                   PopFile = Key  (F7, Ctrl-Tab):  Opens the filename
  8732.                   completion window.  You may not be able to use Ctrl-Tab,
  8733.                   because not all systems recognize it as a keystroke.  See
  8734.                   ClearKeyMap on page 148 if you need to remove the default
  8735.                   mapping of Ctrl-Tab to this function.
  8736.  
  8737.                   PrevFile = Key  (F8, Shift-Tab):  Gets the previous
  8738.                   matching filename.  See ClearKeyMap on page 148 if you
  8739.                   need to remove the default mapping of Shift-Tab to this
  8740.                   function.
  8741.  
  8742.                   PrevHistory = Key  (Up):  Recalls the previous command
  8743.                   from the command history.
  8744.  
  8745.                   SaveHistory = Key  (Ctrl-K):  Saves the command line in
  8746.                   the command history list without executing it.
  8747.  
  8748.  
  8749.              History and @SELECT Window Keys
  8750.  
  8751.                   The following directives apply only to the command
  8752.                   history window, the directory history window, and
  8753.                   %@SELECT windows.
  8754.  
  8755.                   DirWinOpen = Key (Ctrl-PgUp):  Opens the directory
  8756.                   history window while at the command line.
  8757.  
  8758.                   HistWinBegin = Key (Ctrl-PgUp):  Moves to the first line
  8759.                   of the history when in the history window.
  8760.  
  8761.         -------------------------------------------------------------------
  8762.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 146
  8763.                                                   CHAPTER 5 / CONFIGURATION
  8764.         -------------------------------------------------------------------
  8765.  
  8766.  
  8767.                   HistWinDel = Key (Ctrl-D):  Deletes a line from within
  8768.                   the history window.
  8769.  
  8770.                   HistWinEdit = Key (Ctrl-Enter):  Moves a line from the
  8771.                   history window to the prompt for editing.
  8772.  
  8773.                   HistWinEnd = Key (Ctrl-PgDn):  Moves to the last line of
  8774.                   the history when in the history window.
  8775.  
  8776.                   HistWinExec = Key (Enter):  Executes the selected line in
  8777.                   the history window.
  8778.  
  8779.                   HistWinOpen = Key (PgUp):  Brings up the history window
  8780.                   while at the command line.
  8781.  
  8782.                   NormalHWinKey = Key:  Deassigns a history window key in
  8783.                   order to disable the usual meaning of the key within the
  8784.                   history window.  For details see the NormalKey directive
  8785.                   on page 145.
  8786.  
  8787.  
  8788.              LIST Keys
  8789.  
  8790.                   The keys in the last group of Key Mapping Directives are
  8791.                   effective only inside the LIST command.
  8792.  
  8793.                   ListFind = Key (F):  Prompts and searches for a string.
  8794.  
  8795.                   ListHex = Key (X):  Toggles hexadecimal display mode.
  8796.  
  8797.                   ListHighBit = Key (H):  Toggles LIST's "strip high bit"
  8798.                   option, which can aid in displaying files from certain
  8799.                   word processors.
  8800.  
  8801.                   ListInfo = Key (I):  Displays information about the
  8802.                   current file.
  8803.  
  8804.                   ListNext = Key (N):  Finds the next matching string.
  8805.  
  8806.                   ListPrint = Key (P):  Prints the file on LPT1.
  8807.  
  8808.                   ListWrap = Key (W):  Toggles LIST's wrap option on and
  8809.                   off.  The wrap option wraps text at the right margin.
  8810.  
  8811.                   NormalListKey = Key:  Deassigns a LIST key in order to
  8812.                   disable the usual meaning of the key within LIST.  For
  8813.                   details see the NormalKey directive on page 145.
  8814.  
  8815.  
  8816.  
  8817.  
  8818.         -------------------------------------------------------------------
  8819.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 147
  8820.                                                   CHAPTER 5 / CONFIGURATION
  8821.         -------------------------------------------------------------------
  8822.  
  8823.  
  8824.           ## Advanced Directives
  8825.  
  8826.              These directives are generally used for unusual circumstances,
  8827.              or for diagnosing problems.  Most often they are not needed in
  8828.              normal use.
  8829.  
  8830.  
  8831.              Advanced Directives For 4DOS, 4OS2, and 4DOS/NT
  8832.  
  8833.                   The directives in this section work in 4DOS, 4OS2, and
  8834.                   4DOS/NT.
  8835.  
  8836.                   ClearKeyMap:  Clears all current key mappings.
  8837.                   ClearKeyMap is a special directive which has no value or
  8838.                   "=" after it.  Use ClearKeyMap to make one of the keys in
  8839.                   the default map (Tab, Shift-Tab, Ctrl-Tab, or Ctrl-Bksp)
  8840.                   available for a keystroke alias, or in the [Secondary]
  8841.                   section of the .INI file to clear key mappings inherited
  8842.                   from the primary shell.  ClearKeyMap should appear before
  8843.                   any key mapping directives.  If you want to clear some
  8844.                   but not all of the default mappings, use ClearKeyMap,
  8845.                   then recreate the mappings you want to retain (e.g., with
  8846.                   "NextFile=Tab", etc.).
  8847.  
  8848.                   DescriptionName = File:  Sets the file name in which to
  8849.                   store file descriptions.  The default file name is
  8850.                   DESCRIPT.ION.  Use this directive with caution because
  8851.                   changing the name from the default will make it difficult
  8852.                   to transfer file descriptions to another system.
  8853.  
  8854.                   NextINIFile = File.  The full path and name of the file
  8855.                   must be specified.  All subsequent shells will read the
  8856.                   specified .INI file, and ignore any [Secondary] section
  8857.                   in the original .INI file.  Under 4DOS, if you have a
  8858.                   diskless or floppy-based workstation, NextINIFile will
  8859.                   allow you to shift 4DOS.INI to a network drive for
  8860.                   secondary shells, and avoid all access to the original
  8861.                   boot drive.
  8862.  
  8863.  
  8864.              Advanced Directives For 4DOS Only
  8865.  
  8866.     4DOS          The following advanced directives apply to 4DOS only, and
  8867.                   will not work in 4OS2 or 4DOS/NT.
  8868.  
  8869.                   CritFail = Yes | NO:  This is the same as /F on the
  8870.                   SHELL= line in CONFIG.SYS.  It intercepts all DOS
  8871.                   critical errors and returns a Fail to each.  We do not
  8872.                   recommend this on most systems, because you will not have
  8873.                   a chance to react to a critical error and correct the
  8874.  
  8875.         -------------------------------------------------------------------
  8876.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 148
  8877.                                                   CHAPTER 5 / CONFIGURATION
  8878.         -------------------------------------------------------------------
  8879.  
  8880.  
  8881.                   problem that caused it.  It is intended for use on
  8882.                   bulletin boards or other systems where unattended
  8883.                   operation is required without user prompts.
  8884.  
  8885.                   DiskReset = Yes | NO:  Enables or disables disk resets
  8886.                   after COPY, DEL/ERASE, DESCRIBE, MOVE, and REN/RENAME,
  8887.                   before DIR, and when starting 4DOS.  Set to Yes if you
  8888.                   have problems with disk change detection on non-standard
  8889.                   or cached floppy disk drives, or with network software
  8890.                   which doesn't always properly flush data to the disk.
  8891.                   Such problems are very rare, so normally No is the best
  8892.                   choice.  Setting DiskReset to Yes may increase the time
  8893.                   required to start a secondary shell, and may reduce the
  8894.                   performance of DIR, COPY, MOVE, and RENAME, when using a
  8895.                   "staged-write" disk cache such as Microsoft's SmartDrive.
  8896.                   See APPNOTES.DOC for details on how specific cache
  8897.                   software is affected by the DiskReset setting.
  8898.  
  8899.                   DVCleanup = YES | No.  Controls the cleanup of 4DOS
  8900.                   resources (the shell number and any disk swap file) when
  8901.                   you close a 4DOS window from the DESQview menu.  See
  8902.                   APPNOTES.DOC  for more details.
  8903.  
  8904.                   FullINT2E = YES | No:  Enables full support for the
  8905.                   COMMAND.COM "back door" (interrupt 2E) which some
  8906.                   programs use to execute commands.  Effective only in a
  8907.                   primary shell loaded via the SHELL= command in
  8908.                   CONFIG.SYS.  See Appendix B of the 4DOS Introduction and
  8909.                   Installation Guide for details on using INT 2E.  Also,
  8910.                   see APPNOTES.DOC for information on programs known to
  8911.                   require this option.  If this directive is set to No, INT
  8912.                   2E will return immediately to the calling program without
  8913.                   taking any action.  Setting FullINT2E to No reduces the
  8914.                   size of the primary shell by about 100 bytes.
  8915.  
  8916.                   Inherit = YES | No:  .INI file data, aliases, and the
  8917.                   history list are normally passed to secondary shells
  8918.                   automatically.  No disables this feature.
  8919.  
  8920.                   MessageServer = YES | No:  For compatibility with
  8921.                   COMMAND.COM in MS-DOS 4.x and above, 4DOS includes a
  8922.                   "message server" that retrieves error message text for
  8923.                   DOS external commands like DISKCOPY and FORMAT.  The
  8924.                   message server increases the size of the resident portion
  8925.                   of 4DOS by about 200 bytes.  No disables the message
  8926.                   server and saves this space, but will cause more cryptic
  8927.                   error messages such as "Parse error 3" or "Extended error
  8928.                   7" from some DOS external commands.  The message server
  8929.                   is automatically enabled by 4DOS in the primary 4DOS
  8930.  
  8931.  
  8932.         -------------------------------------------------------------------
  8933.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 149
  8934.                                                   CHAPTER 5 / CONFIGURATION
  8935.         -------------------------------------------------------------------
  8936.  
  8937.  
  8938.                   shell loaded from CONFIG.SYS when running under MS-DOS
  8939.                   4.x or above, and disabled elsewhere.
  8940.  
  8941.                   NetwareNames = Yes | NO.  Set to Yes to include strings
  8942.                   in the resident portion of 4DOS which Novell Netware
  8943.                   searches for when it loads.  NetwareNames should be Yes
  8944.                   for Netware systems to avoid problems with destroyed
  8945.                   environment variables during LOGIN.  Setting NetwareNames
  8946.                   to Yes increases 4DOS's low DOS memory usage by 112
  8947.                   bytes.
  8948.  
  8949.                   OutputBIOS = Yes | NO:  Determines whether 4DOS uses the
  8950.                   BIOS for all screen displays.  If set to No, 4DOS will
  8951.                   use direct screen writes for color-coded directories and
  8952.                   the DRAWBOX, DRAWHLINE, DRAWVLINE, LIST, SELECT, SCRPUT,
  8953.                   and VSCRPUT commands.  If set to Yes, 4DOS will perform
  8954.                   these commands using BIOS calls.  This directive is only
  8955.                   needed for compatibility with unusual display adapters,
  8956.                   such as those used on Japanese systems running DOS/V.
  8957.                   Setting OutputBIOS to Yes may substantially reduce the
  8958.                   speed of the affected commands.
  8959.  
  8960.                   SDFlush = Yes | NO:  Determines whether 4DOS instructs
  8961.                   Microsoft SMARTDRV (and other SMARTDRV-compatible disk
  8962.                   caching programs) to flush any "write-behind" buffers to
  8963.                   the disk before the 4DOS prompt is displayed.  Setting
  8964.                   SDFlush to Yes may decrease performance, but will ensure
  8965.                   that SMARTDRV is instructed to write all modified data to
  8966.                   disk before the prompt is displayed.  Also, SDFlush does
  8967.                   not take into account any changes in the design or
  8968.                   behavior of SMARTDRV after the release of 4DOS, or your
  8969.                   SMARTDRV startup options.  Therefore setting SDFlush to
  8970.                   Yes does not guarantee that write-behind data will be
  8971.                   written to disk before the prompt is displayed, only that
  8972.                   SMARTDRV will be instructed to do so.
  8973.  
  8974.                   StackSize = nnnn (4096):  Set the 4DOS internal stack
  8975.                   size.  The allowable range of values is 4096 to 8192.
  8976.  
  8977.                   If you use complex combinations of "prefix" commands like
  8978.                   DO, EXCEPT, FOR, GLOBAL, IF, IFF, and SELECT on the same
  8979.                   command line, and especially if you use these commands in
  8980.                   multiple nested batch files or GOSUBs, you may encounter
  8981.                   a "4DOS internal stack overflow" error.  If you do, you
  8982.                   should use this directive to increase the amount of stack
  8983.                   space available.
  8984.  
  8985.                   For virtually all users, the default stack size will be
  8986.                   sufficient.  If you increase the stack size, you will
  8987.                   increase the size of 4DOS's transient portion in memory,
  8988.  
  8989.         -------------------------------------------------------------------
  8990.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 150
  8991.                                                   CHAPTER 5 / CONFIGURATION
  8992.         -------------------------------------------------------------------
  8993.  
  8994.  
  8995.                   and the size of the 4DOS swap area, by the amount of the
  8996.                   stack size increase.
  8997.  
  8998.                   You will not normally encounter a stack size problem with
  8999.                   4OS2 or 4DOS/NT, because both can increase the size of
  9000.                   the internal stack dynamically.  This is not feasible
  9001.                   under DOS.
  9002.  
  9003.                   SwapReopen = Yes | NO:  Set to Yes to enable reopening of
  9004.                   the 4DOS swap file if it is closed by another program.
  9005.                   This is required when swapping 4DOS to Novell Netware
  9006.                   drives or when using other applications which close
  9007.                   4DOS's swap file.  In all other circumstances, it is only
  9008.                   useful for diagnostic purposes.  Setting SwapReopen to
  9009.                   Yes also disables the reduced swapping size normally used
  9010.                   in 4DOS secondary shells.
  9011.  
  9012.                   UniqueSwapName = Yes | No:  Set to Yes to change the disk
  9013.                   swap file name from 4DOSSWAP.nnn to a unique name
  9014.                   generated by 4DOS, with an extension of "4SW" (e.g.,
  9015.                   A1CD6B11.4SW).  This prevents conflicts between swap
  9016.                   files in different shells; it is only necessary when you
  9017.                   are using disk swapping with a COMMAND.COM primary shell
  9018.                   or in an OS/2 2.x DOS session.  The default is Yes in
  9019.                   OS/2 DOS sessions and No elsewhere.  UniqueSwapName only
  9020.                   works in DOS 3.0 and above, and in OS/2 DOS sessions, and
  9021.                   applies only to disk swapping.
  9022.  
  9023.  
  9024.              Examples
  9025.  
  9026.              The following examples will give you an idea of the types of
  9027.              things that can be done with the .INI file.  The comments on
  9028.              each directive explain what it does.
  9029.  
  9030.              First, a very simple 4DOS example that just sets up swapping
  9031.              and environment size, leaving everything else at its default
  9032.              value:
  9033.  
  9034.                   Swapping = ems, c:\           ;try EMS, then C: root
  9035.                   Environment = 1024            ;set environment size
  9036.  
  9037.              Here's another 4DOS example, for a system which supports Upper
  9038.              Memory blocks (UMBs).  Several settings take advantage of
  9039.              UMBs, and others modify the 4DOS configuration to match the
  9040.              user's preferences.  Note that the comment for the Swapping
  9041.              directive is on separate lines before the directive itself, as
  9042.              no comments are allowed in string directives:
  9043.  
  9044.                   Environment = 3072            ;expand environment to 3K
  9045.  
  9046.         -------------------------------------------------------------------
  9047.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 151
  9048.                                                   CHAPTER 5 / CONFIGURATION
  9049.         -------------------------------------------------------------------
  9050.  
  9051.  
  9052.                   Alias = 6144                  ;expand aliases to 6K
  9053.                   LocalHistory = No             ;use a global history
  9054.                     ;for swapping try XMS, then RAM disk H:, then
  9055.                     ;hard disk C:
  9056.                   Swapping = xms, h:\, c:\
  9057.                   UMBLoad = Yes                 ;res. part of 4DOS in UMB
  9058.                   UMBEnvironment = Yes          ;master environment in UMB
  9059.                   UMBHistory = Yes              ;global history in UMB
  9060.                   BatchEcho = No                ;default is ECHO OFF
  9061.                   EditMode = Insert             ;editor in insert mode
  9062.                   CursorOver = 100              ;overstrike cursor 100%
  9063.                   CursorIns = 10                ;insert cursor 10%
  9064.  
  9065.              This example for 4OS2 configures certain special characters to
  9066.              match 4DOS, and changes other default settings to suit the
  9067.              user's preferences.  All of these settings except HelpBook
  9068.              would also work in 4DOS or 4DOS/NT.  You must enter the actual
  9069.              escape character, not the string "<Ctrl-X>", in the EscapeChar
  9070.              directive:
  9071.  
  9072.                   PauseOnError = No             ;don't stop on INI errors
  9073.                   CommandSep = ^                ;4DOS command separator
  9074.                   EscapeChar = <Ctrl-X>         ;4DOS escape character
  9075.                   ParameterChar = &             ;4DOS parameter character
  9076.                   BatchEcho = No                ;default to ECHO OFF
  9077.                   HelpBook = 4OS2
  9078.                   History = 2048                ;expand history to 2K bytes
  9079.                   BeepFreq = 880                ;make beep higher pitch
  9080.                   EditMode = Insert             ;insert mode for cmd edit
  9081.                   CursorOver = 100              ;overstrike cursor 100%
  9082.                   CursorIns = 10                ;insert cursor 10%
  9083.                   ListFind = F5                 ;F5 does a find in LIST
  9084.                   ListNext = F6                 ;and F6 does a find next
  9085.                   StdColors = bri cya on blu    ;default colors
  9086.                   ListColors = bri whi on blu   ;colors for LIST
  9087.                   SelectColors = bri whi on blu ;same colors for SELECT
  9088.                   colordir = DIRS:bri yel;com exe bat btm cmd:bri whi
  9089.  
  9090.  
  9091.  
  9092.  
  9093.  
  9094.  
  9095.  
  9096.  
  9097.  
  9098.  
  9099.  
  9100.  
  9101.  
  9102.  
  9103.         -------------------------------------------------------------------
  9104.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 152
  9105.                                         CHAPTER 6 / COMMAND REFERENCE GUIDE
  9106.         -------------------------------------------------------------------
  9107.  
  9108.  
  9109.  
  9110.         CHAPTER 6 / COMMAND REFERENCE GUIDE
  9111.  
  9112.  
  9113.         The following pages are a complete guide and reference to the 4DOS,
  9114.         4OS2, and 4DOS/NT commands that are available from the command
  9115.         line, in aliases, and in batch files.  All of these commands are
  9116.         internal commands, which means that the command processor performs
  9117.         the activity you have requested without running another program.
  9118.         (See page 19 for more information on internal and external
  9119.         commands.)
  9120.  
  9121.         We offer over 80 internal commands, many more than any version of
  9122.         COMMAND.COM or CMD.EXE.  These neither replace nor interfere with
  9123.         external commands like BACKUP, CHKDSK, DISKCOPY, or XCOPY.  You can
  9124.         continue to use those utilities like you always have.  Also, each
  9125.         of our command processors has been designed to be compatible with
  9126.         virtually all traditional internal commands, and to enhance most of
  9127.         those commands with additional options and capabilities.  Once you
  9128.         have installed your new command processor, you can continue using
  9129.         the commands that you already know and get the same results.
  9130.  
  9131.         We have made no attempt to document external DOS, OS/2, and Windows
  9132.         NT commands in this reference, partly because they are explained in
  9133.         your operating system manual, and partly because external commands,
  9134.         and the options available with each command, vary widely from one
  9135.         operating system to another and from one version to another.  The
  9136.         4DOS HELP system does include information about standard DOS
  9137.         external commands, and the 4OS2 HELP system can be configured to
  9138.         display information about OS/2 external commands (see the
  9139.         Introduction and Installation Guide for each product for further
  9140.         details).
  9141.  
  9142.         Most 4DOS, 4OS2, and 4DOS/NT commands are either enhanced
  9143.         traditional commands or are entirely new (a few are the same as
  9144.         traditional commands).  If you are comfortable using traditional
  9145.         commands, you can switch to your new command processor without
  9146.         making any changes in your habits.  But you will be missing a lot
  9147.         of the power of these enhancements and new commands unless you take
  9148.         a few minutes to see what's available here.  Make sure you don't
  9149.         skip a section of this reference just because you already know how
  9150.         to use a traditional command with the same name.
  9151.  
  9152.         If you come across terms or concepts in this chapter that you are
  9153.         unsure about, please refer to Chapter 1 / General Concepts, the
  9154.         Glossary on page 381, or the Index.
  9155.  
  9156.  
  9157.  
  9158.  
  9159.  
  9160.         -------------------------------------------------------------------
  9161.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 153
  9162.                                         CHAPTER 6 / COMMAND REFERENCE GUIDE
  9163.         -------------------------------------------------------------------
  9164.  
  9165.  
  9166.  
  9167.  
  9168.         Command Categories
  9169.  
  9170.              The best way to learn the commands is to use them and
  9171.              experiment with them.  We urge you to browse through this
  9172.              chapter occasionally and look for commands that might help
  9173.              simplify your computing life.  The following lists categorize
  9174.              the available commands by topic and will help you find the
  9175.              ones that you need.  Commands listed below with an asterisk
  9176.              [*] are not available in all command processors; see the list
  9177.              at the end for details.
  9178.  
  9179.              System configuration:
  9180.  
  9181.                BREAK *        CHCP *         CLS            COLOR
  9182.                CTTY *         DATE           FREE           HISTORY
  9183.                KEYS *         KEYBD          LH/LOADHIGH*   LOG
  9184.                MEMORY         PROMPT         REBOOT         SETDOS
  9185.                SWAPPING *     TIME           VER            VERIFY
  9186.                VOL
  9187.  
  9188.              File and directory management:
  9189.  
  9190.                ATTRIB         COPY           DEL/ERASE      DESCRIBE
  9191.                LIST           MOVE           REN/RENAME     SELECT
  9192.                TRUENAME *     TYPE
  9193.  
  9194.              Subdirectory management:
  9195.  
  9196.                CD/CHDIR       CDD            DIR            DIRS
  9197.                MD/MKDIR       POPD           PUSHD          RD/RMDIR
  9198.  
  9199.              Input and output:
  9200.  
  9201.                DRAWBOX        DRAWHLINE      DRAWVLINE      ECHO
  9202.                ECHOS          INKEY          INPUT          KEYSTACK *
  9203.                MSGBOX *       SCREEN         SCRPUT         TEXT
  9204.                VSCRPUT
  9205.  
  9206.              Commands primarily for use in or with batch files and aliases
  9207.              (some work only in batch files; see the individual commands
  9208.              for details):
  9209.  
  9210.                ALIAS          BEEP           CALL           CANCEL
  9211.                DELAY          DO             ENDLOCAL       FOR
  9212.                GLOBAL         GOSUB          GOTO           IF
  9213.                IFF            LOADBTM        ON             PAUSE
  9214.                QUIT           REM            RETURN         SETLOCAL
  9215.                SHIFT          TEXT           UNALIAS
  9216.  
  9217.         -------------------------------------------------------------------
  9218.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 154
  9219.                                         CHAPTER 6 / COMMAND REFERENCE GUIDE
  9220.         -------------------------------------------------------------------
  9221.  
  9222.  
  9223.              Environment and path commands:
  9224.  
  9225.                DPATH *        ESET           PATH           SET
  9226.                UNSET
  9227.  
  9228.              Window management commands:
  9229.  
  9230.                ACTIVATE *     TITLE *        WINDOW *
  9231.  
  9232.              Other commands:
  9233.  
  9234.                ?              DETACH *       EXCEPT         EXIT
  9235.                FFIND          HELP           LIST           START
  9236.                TEE            TIMER          Y
  9237.  
  9238.              * Some of these commands are not included in one or more of
  9239.              our command processors.  Usually a command is left out of a
  9240.              product when it is not useful or cannot be implemented in that
  9241.              environment (for example, the DETACH command is related to
  9242.              multitasking, and is not available under DOS because DOS does
  9243.              not offer multitasking).  The commands that are specific to
  9244.              particular products are:
  9245.  
  9246.                ACTIVATE.....4DOS/NT           KEYSTACK......4DOS
  9247.                BREAK........4DOS, 4DOS/NT     LH/LOADHIGH...4DOS
  9248.                CHCP.........4DOS, 4OS2        MSGBOX........4DOS/NT
  9249.                CTTY.........4DOS.             SWAPPING......4DOS
  9250.                DETACH.......4OS2, 4DOS/NT     TITLE.........4DOS/NT
  9251.                DPATH........4OS2.             TRUENAME......4DOS
  9252.                KEYS.........4OS2, 4DOS/NT     WINDOW........4OS2, 4DOS/NT
  9253.  
  9254.  
  9255.         How to Use the Command Descriptions
  9256.  
  9257.              Each of the internal commands is described in detail on the
  9258.              following pages.  The descriptions are arranged
  9259.              alphabetically, and each includes examples that will help you
  9260.              learn to use the commands.
  9261.  
  9262.              Each description begins with the name of the command on the
  9263.              left side of the page.  If the command is only available in
  9264.              some of our products, those products are listed next to the
  9265.              command name, and in the page header.  Commands marked "New"
  9266.              on the right side of the page are unique to 4DOS, 4OS2, or
  9267.              4DOS/NT.  Those marked "Enhanced" are similar to traditional
  9268.              commands but add new features and options.  The commands
  9269.              marked "Compatible" follow the syntax and features of the
  9270.              traditional command with the same name.
  9271.  
  9272.  
  9273.  
  9274.         -------------------------------------------------------------------
  9275.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 155
  9276.                                         CHAPTER 6 / COMMAND REFERENCE GUIDE
  9277.         -------------------------------------------------------------------
  9278.  
  9279.  
  9280.              The name is followed by a sentence or two that briefly
  9281.              describes the command's purpose or major function.  That
  9282.              sentence should help you determine quickly whether you have
  9283.              found the command you are seeking.
  9284.  
  9285.              The next part of each description shows the command's format
  9286.              or syntax.  The format line uses certain conventions to
  9287.              describe how the command should be entered and to create
  9288.              reference points for the text describing the command:
  9289.  
  9290.                   Words in UPPER CASE must be spelled exactly as they are
  9291.                   shown (although you can type them in either upper or
  9292.                   lower case, or a combination).  If a word is shown partly
  9293.                   in upper case (for example BLInk), only the upper case
  9294.                   portion is required, the rest is optional.
  9295.  
  9296.                   Words shown in italics (for example source or filename)
  9297.                   are meant to be replaced by other words or values.  Each
  9298.                   of these words is explained directly beneath the format
  9299.                   line and discussed in more detail in the text description
  9300.                   of the command.  When the word stands for a file name,
  9301.                   you can use a simple name like MYFILE.TXT, or include a
  9302.                   drive letter and/or a full path, like
  9303.                   C:\MYDIR\MYFILE.TXT.
  9304.  
  9305.                   Items followed by an ellipsis (three periods [...]) may
  9306.                   be repeated.  For example, filename ... means you may
  9307.                   enter one or more file names at this point in the
  9308.                   command.
  9309.  
  9310.                   Text shown in [square brackets] is optional.  Text
  9311.                   outside of square brackets must be entered literally (if
  9312.                   it is capitalized) or replaced by other words or values
  9313.                   (if it is in italics).
  9314.  
  9315.                   Vertical bars [|] represent a choice; you can pick one
  9316.                   option or another but not both.  For example, the
  9317.                   following format shows that the command may be followed
  9318.                   by the word ON or the word OFF, but not both:
  9319.  
  9320.                        COMMAND [ ON | OFF ]
  9321.  
  9322.                   A slash followed by a letter, like [/X], is an "option"
  9323.                   or "switch" which controls the effect of a command.  Many
  9324.                   commands have several switches, and you are usually free
  9325.                   to use none, one, or several to make a command behave as
  9326.                   you wish.  If you use a single switch, you must precede
  9327.                   it with a slash.  If you use several switches, in most
  9328.                   cases you can put them together with one slash or use
  9329.                   separate slashes.  For example, if you wanted to use
  9330.  
  9331.         -------------------------------------------------------------------
  9332.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 156
  9333.                                         CHAPTER 6 / COMMAND REFERENCE GUIDE
  9334.         -------------------------------------------------------------------
  9335.  
  9336.  
  9337.                   switches X, Y, and Z for a command, you could type them
  9338.                   three different ways:
  9339.  
  9340.                        command /x /y /z
  9341.                        command /x/y/z
  9342.                        command /xyz
  9343.  
  9344.                   A few switches, particularly in the DIR, SELECT, and
  9345.                   START commands, use two or more characters.  If you need
  9346.                   to follow a multi-letter switch with another switch, the
  9347.                   second switch must have its own slash to avoid ambiguity.
  9348.  
  9349.              Included in the format section is an explanation of each
  9350.              replaceable argument and a one or two word explanation of each
  9351.              switch.  Many descriptions also list related commands to help
  9352.              you find the exact command you want.
  9353.  
  9354.              For file handling commands, a section called "Selection"
  9355.              appears immediately after the format section.  This section
  9356.              lists the file-handling features that the command supports.
  9357.              The list may include mention of extended wildcards (see page
  9358.              59); multiple file names (page 66); include lists (page 67);
  9359.              and date, time, and size ranges (see page 62).
  9360.  
  9361.              Next, you'll find a description of the command's usage.  This
  9362.              description normally starts with the basic functions of a
  9363.              command and gradually adds more details.  We've also included
  9364.              many examples to help you see the command in action.  In the
  9365.              examples, characters in bold type represent input from the
  9366.              user.  Characters in normal type represent prompts or
  9367.              responses from the command processor, or lines in a batch
  9368.              file.
  9369.  
  9370.              The last part of each description is a detailed explanation of
  9371.              the options or switches available for each command, in
  9372.              alphabetical order.  Occasionally, we've included more
  9373.              examples in this section to demonstrate how a switch is used
  9374.              or how multiple switches interact.
  9375.  
  9376.              Most of the commands and their switches have the same use in
  9377.              4DOS, 4OS2, and 4DOS/NT.  When a command, feature, or switch
  9378.              applies to a single product, we mention it specifically in the
  9379.              text.  When an entire paragraph applies to a specific product,
  9380.              we use marginal text to identify that product.  When an entire
  9381.              command is only available in one or two products, the products
  9382.              are listed next to the command name, and in the page headings.
  9383.  
  9384.     4DOS      marks information that applies only to 4DOS.
  9385.  
  9386.     4OS2      marks information that applies only to 4OS2.
  9387.  
  9388.         -------------------------------------------------------------------
  9389.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 157
  9390.                                         CHAPTER 6 / COMMAND REFERENCE GUIDE
  9391.         -------------------------------------------------------------------
  9392.  
  9393.  
  9394.     4NT       marks information that applies only to 4DOS/NT.
  9395.  
  9396.              Occasionally, a command or switch will be marked with two of
  9397.              these marginal notations when it applies to two different
  9398.              products.
  9399.  
  9400.              An exclamation point [!] to the left of a paragraph means that
  9401.              paragraph contains a caution or warning you should observe
  9402.              when using the feature it discusses.
  9403.  
  9404.              In the Usage and Options sections you may see the symbol ##.
  9405.              This indicates a more in-depth discussion or an advanced topic
  9406.              which you can skip if you are new to the command; come back to
  9407.              this topic later for more details, or if you're having trouble
  9408.              with the command.  In most cases the remainder of the section
  9409.              after such a symbol is devoted to similar information.
  9410.  
  9411.              The ## doesn't mean that only advanced users will need the
  9412.              information - you may find it useful even if you're relatively
  9413.              new to computers or to our products.  But it does mean that
  9414.              you can skip the marked section and still understand and use
  9415.              the basic features of the command.  If a ## appears before the
  9416.              "Usage" heading, it indicates that the entire command is
  9417.              generally used only in unusual situations or by more advanced
  9418.              users.
  9419.  
  9420.              When you see a ## in the list of options, remember that the
  9421.              options are listed alphabetically, so there may be more basic
  9422.              options discussed later in the list, after a more complex or
  9423.              advanced option marked with ##.  Don't stop reading the option
  9424.              list the first time you see the mark.
  9425.  
  9426.  
  9427.  
  9428.  
  9429.  
  9430.  
  9431.  
  9432.  
  9433.  
  9434.  
  9435.  
  9436.  
  9437.  
  9438.  
  9439.  
  9440.  
  9441.  
  9442.  
  9443.  
  9444.  
  9445.         -------------------------------------------------------------------
  9446.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 158
  9447.                                                                           ?
  9448.         -------------------------------------------------------------------
  9449.  
  9450.  
  9451.         ?                                                             (New)
  9452.  
  9453.         Purpose:    Display a list of internal commands or prompt for a
  9454.                     command.
  9455.  
  9456.         Format:     ? ["prompt text" command]
  9457.  
  9458.         Usage:      ? by itself displays a list of internal commands.  For
  9459.                     help with these commands, see the HELP command.
  9460.  
  9461.                     When you use the ? command by itselt, you will see a
  9462.                     display like this (the partial list below is for 4DOS;
  9463.                     you will see a slightly different list for 4OS2 or
  9464.                     4DOS/NT):
  9465.  
  9466.                          c:\> ?
  9467.                          ?            ALIAS       ATTRIB       BEEP
  9468.                          BREAK        CALL        CANCEL       CD
  9469.                          CDD          CHCP        CHDIR        CLS
  9470.                          COLOR        COPY        CTTY         DATE
  9471.                          .....
  9472.                          .....
  9473.  
  9474.                          TIMER        TRUENAME    TYPE         UNALIAS
  9475.                          UNSET        VER         VERIFY       VOL
  9476.                          VSCRPUT      Y
  9477.  
  9478.                     If you have disabled a command with SETDOS /I, it will
  9479.                     not appear in the list.
  9480.  
  9481.                     If you add prompt text and a command, ? will display
  9482.                     the prompt followed by "(Y/N)?" and wait for the
  9483.                     user's response.  If the user presses "Y" or "y", the
  9484.                     command will be executed.  If the user presses "N" or
  9485.                     "n", the command will be ignored.
  9486.  
  9487.                     For example, the following command might be used in a
  9488.                     batch file:
  9489.  
  9490.                          ? "Load the network" call netstart.btm
  9491.  
  9492.  
  9493.  
  9494.  
  9495.  
  9496.  
  9497.  
  9498.  
  9499.  
  9500.  
  9501.  
  9502.         -------------------------------------------------------------------
  9503.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 159
  9504.                                                      [4DOS/NT]     ACTIVATE
  9505.         -------------------------------------------------------------------
  9506.  
  9507.  
  9508.         ACTIVATE      [4DOS/NT]                                       (New)
  9509.  
  9510.         Purpose:    Activate a window, set its state, or change its title.
  9511.  
  9512.         Format:     ACTIVATE "window" [MAX | MIN | RESTORE | CLOSE |
  9513.                     "title" ]
  9514.  
  9515.                     window:  Current title of window to work with.
  9516.                     title:  New title for window.
  9517.  
  9518.                     See also:  START, TITLE, and WINDOW.
  9519.  
  9520.         Usage:      Both the current name of the window and the new name,
  9521.                     if any, must be enclosed in double quotes.  The quotes
  9522.                     will not appear as part of the title bar text.
  9523.  
  9524.                     If no options are used, the window named in the
  9525.                     command will become the active window and be able to
  9526.                     receive keystrokes and mouse commands.
  9527.  
  9528.                     The MAX option expands the window to its maximum size,
  9529.                     the MIN option reduces the window to an icon, and the
  9530.                     RESTORE option returns the window to its default size
  9531.                     and location on the desktop.  The CLOSE option closes
  9532.                     the window and ends the session running in the window.
  9533.  
  9534.                     This example renames and maximizes the window called
  9535.                     "4DOS/NT":
  9536.  
  9537.                          [c:\] activate "4DOS/NT" max "4DOS/NT is Great!"
  9538.  
  9539.  
  9540.  
  9541.  
  9542.  
  9543.  
  9544.  
  9545.  
  9546.  
  9547.  
  9548.  
  9549.  
  9550.  
  9551.  
  9552.  
  9553.  
  9554.  
  9555.  
  9556.  
  9557.  
  9558.  
  9559.         -------------------------------------------------------------------
  9560.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 160
  9561.                                                                       ALIAS
  9562.         -------------------------------------------------------------------
  9563.  
  9564.  
  9565.         ALIAS                                                         (New)
  9566.  
  9567.         Purpose:    Create new command names that execute one or more
  9568.                     commands or redefine default options for existing
  9569.                     commands; assign commands to keystrokes; load or
  9570.                     display the list of defined alias names.
  9571.  
  9572.         Format:     ALIAS [/P /R file...] [name[=][value]]
  9573.  
  9574.                     file:  One or more files to read for alias
  9575.                     definitions.
  9576.                     name:  Name for an alias, or for the key to execute
  9577.                     the alias.
  9578.                     value:  Text to be substituted for the alias name.
  9579.  
  9580.                     /P(ause)                 /R(ead file)
  9581.  
  9582.                     See also:  UNALIAS, and Aliases on page 77.
  9583.  
  9584.         Usage:      The ALIAS command lets you create new command names or
  9585.                     redefine internal commands.  It also lets you assign
  9586.                     one or more commands to a single keystroke.  An alias
  9587.                     is often used to execute a complex series of commands
  9588.                     with a few keystrokes or to create "in memory batch
  9589.                     files" that run much faster than disk-based batch
  9590.                     files.
  9591.  
  9592.                     For example, if you would rather type D instead of DIR
  9593.                     /W, you would use the command:
  9594.  
  9595.                          c:\> alias d = dir /w
  9596.  
  9597.                     Now when you type a single d as a command, it will be
  9598.                     translated into a DIR /W command.
  9599.  
  9600.                     If you define aliases for commonly used application
  9601.                     programs, you can often remove the directories they're
  9602.                     stored in from the PATH.  For example, if you use
  9603.                     Quattro Pro and had the C:\QPRO directory in your
  9604.                     path, you could define the following alias:
  9605.  
  9606.                          c:\> alias qpro = c:\qpro\q.exe
  9607.  
  9608.                     With this alias defined, you can probably remove
  9609.                     C:\QPRO from your path.  Quattro Pro will now load
  9610.                     much faster than it would if the command processor had
  9611.                     to search the PATH for it.  In addition, the PATH can
  9612.                     be shorter, which will speed up searches for other
  9613.                     programs.
  9614.  
  9615.  
  9616.         -------------------------------------------------------------------
  9617.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 161
  9618.                                                                       ALIAS
  9619.         -------------------------------------------------------------------
  9620.  
  9621.  
  9622.                     If you apply this technique for each application
  9623.                     program, you can often reduce your PATH to just two or
  9624.                     three directories containing utility programs, and
  9625.                     significantly reduce the time it takes to load most
  9626.                     software on your system.  Before removing a directory
  9627.                     from the PATH, you will need to define aliases for all
  9628.                     the executable programs you commonly use which are
  9629.                     stored in that directory.
  9630.  
  9631.                     Aliases are stored in memory, and are not saved
  9632.                     automatically when you turn off your computer or end
  9633.                     your current session.  See page 167 for information on
  9634.                     saving and reloading your aliases.
  9635.  
  9636.  
  9637.                     Multiple Commands and Special Characters in Aliases
  9638.  
  9639.                     An alias can represent more than one command.  For
  9640.                     example:
  9641.  
  9642.                          c:\> alias letters = `cd \letters ^ text`
  9643.  
  9644.                     creates a new command called LETTERS.  The command
  9645.                     first uses CD to change to a subdirectory called
  9646.                     \LETTERS and then runs a program called TEXT.  The
  9647.                     caret [^] is the 4DOS command separator and indicates
  9648.                     that the two commands are distinct and should be
  9649.                     executed sequentially.  (The 4OS2 and 4DOS/NT command
  9650.                     separator is normally an ampersand [&].)
  9651.  
  9652.                     Aliases make extensive use of the command separator
  9653.                     (see page 47), and the parameter character (see page
  9654.                     140), and may also use the escape character (see page
  9655.                     73).  These characters differ between 4DOS and 4OS2 or
  9656.                     4DOS/NT.  In the text and examples below, we use the
  9657.                     4DOS characters.  The difference is also explained the
  9658.                     first time each character is used.  Be sure to insert
  9659.                     the correct characters for the command processor you
  9660.                     are using.  If you want to use the same aliases under
  9661.                     different command processors, see page 74.
  9662.  
  9663.                     When you type alias commands at the command line or in
  9664.                     a batch file, you must use back-quotes [`] around the
  9665.                     definition if it contains multiple commands,
  9666.                     parameters (discussed below), environment variables,
  9667.                     redirection, or piping.  The back-quotes prevent
  9668.                     premature expansion of these arguments.  You may use
  9669.                     back-quotes around other definitions, but they are not
  9670.                     required.  (You do not need back-quotes when your
  9671.                     aliases are loaded from an ALIAS /R file; see below
  9672.  
  9673.         -------------------------------------------------------------------
  9674.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 162
  9675.                                                                       ALIAS
  9676.         -------------------------------------------------------------------
  9677.  
  9678.  
  9679.                     for details.)  The examples above and below include
  9680.                     back-quotes only when they are required.
  9681.  
  9682.  
  9683.                     Nested Aliases
  9684.  
  9685.                     Aliases may invoke internal commands, external
  9686.                     commands, or other aliases.  (However, an alias may
  9687.                     not invoke itself, except in special cases where an IF
  9688.                     or IFF command is used to prevent an infinite loop.)
  9689.                     The two aliases below demonstrate alias nesting (one
  9690.                     alias invoking another).  The first line defines an
  9691.                     alias which runs a program called WP.EXE that is in
  9692.                     the E:\WP60\ subdirectory.  The second alias changes
  9693.                     directories with the PUSHD command, runs the WP alias,
  9694.                     and then returns to the original directory with the
  9695.                     POPD command:
  9696.  
  9697.                          c:\> alias wp = e:\wp60\wp.exe
  9698.                          c:\> alias w = `pushd c:\wp ^ wp ^ popd`
  9699.  
  9700.                     The second alias above could have included the full
  9701.                     path and name of the WP.EXE program instead of calling
  9702.                     the WP alias.  However, writing two aliases makes the
  9703.                     second one easier to read and understand, and makes
  9704.                     the first alias available for independent use.  If you
  9705.                     rename the WP.EXE program or move it to a new
  9706.                     directory, only the first alias needs to be changed.
  9707.  
  9708.  
  9709.                     Temporarily Disabling Aliases
  9710.  
  9711.                     If you put an asterisk [*] immediately before a
  9712.                     command in the value of an alias definition (the part
  9713.                     after the equal sign), it tells the command processor
  9714.                     not to attempt to interpret that command as another
  9715.                     (nested) alias.  An asterisk used this way must be
  9716.                     preceded by a space or the command separator and
  9717.                     followed immediately by an internal or external
  9718.                     command name.  The asterisk is used to signal that the
  9719.                     following word is the name of an internal or external
  9720.                     command instead of an alias which may have the same
  9721.                     name.  It also allows two popular uses of aliases.
  9722.  
  9723.                     First, by using an asterisk, you can redefine the
  9724.                     default options for any internal command.  For
  9725.                     example, suppose that you always want to use the DIR
  9726.                     command with the /2 (two column) and /P (pause at the
  9727.                     end of each page) options.  The following line will do
  9728.                     just that:
  9729.  
  9730.         -------------------------------------------------------------------
  9731.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 163
  9732.                                                                       ALIAS
  9733.         -------------------------------------------------------------------
  9734.  
  9735.  
  9736.                          c:\> alias dir = *dir /2/p
  9737.  
  9738.                     If you didn't include the asterisk, the second DIR on
  9739.                     the line would be the name of the alias itself, and
  9740.                     the command processor would repeatedly re-invoke the
  9741.                     DIR alias, rather than running the DIR command.  This
  9742.                     would cause an "Alias loop" or "Command line too long"
  9743.                     error.  The asterisk forces interpretation of the
  9744.                     second DIR as a command, not an alias.
  9745.  
  9746.                     Second, an asterisk also helps you keep the names of
  9747.                     internal commands from conflicting with the names of
  9748.                     external programs.  For example, suppose you have a
  9749.                     program called LIST.COM.  Normally, the internal LIST
  9750.                     command will run anytime you type LIST.  But two
  9751.                     simple aliases will give you access to both the
  9752.                     LIST.COM program and the LIST command:
  9753.  
  9754.                          c:\> alias list = c:\util\list.com
  9755.                          c:\> alias display = *list
  9756.  
  9757.                     The first line above defines LIST as an alias for the
  9758.                     LIST.COM program.  If you stopped there, the external
  9759.                     program would run every time you typed LIST and you
  9760.                     would not have easy access to the internal LIST
  9761.                     command.  The second line renames the internal LIST
  9762.                     command as DISPLAY.  The asterisk is needed in the
  9763.                     second command to indicate that the following word
  9764.                     means the internal command LIST, not the LIST alias
  9765.                     which runs your external program.
  9766.  
  9767.                     Another way to understand the asterisk is to remember
  9768.                     that a command is always checked for an alias first,
  9769.                     then for an internal or external command, or a batch
  9770.                     file (see page 121).  The asterisk at the beginning of
  9771.                     a command name simply skips over the usual check for
  9772.                     aliases when processing that command, and allows the
  9773.                     command processor to go straight to checking for an
  9774.                     internal command, external command, or batch file.
  9775.  
  9776.                     You can also use an asterisk before a command that you
  9777.                     enter at the command line or in a batch file.  If you
  9778.                     do, that command won't be interpreted as an alias.
  9779.                     This can be useful when you want to be sure you are
  9780.                     running the true, original command and not an alias
  9781.                     with the same name, or temporarily defeat the purpose
  9782.                     of an alias which changes the meaning or behavior of a
  9783.                     command.  For example, above we defined an alias for
  9784.                     DIR which made directories display in 2-column paged
  9785.                     mode by default.  If you wanted to see a directory
  9786.  
  9787.         -------------------------------------------------------------------
  9788.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 164
  9789.                                                                       ALIAS
  9790.         -------------------------------------------------------------------
  9791.  
  9792.  
  9793.                     display in the normal single-column, non-paged mode,
  9794.                     you could enter the command *DIR and the alias would
  9795.                     be ignored during that one command.
  9796.  
  9797.  
  9798.                     Partial Alias Names
  9799.  
  9800.                     You can also use an asterisk in the name of an alias.
  9801.                     When you do, the characters following the asterisk are
  9802.                     optional when you invoke the alias command.  (Use of
  9803.                     an asterisk in the alias name is unrelated to the use
  9804.                     of an asterisk in the alias value discussed above.)
  9805.                     For example, with this alias:
  9806.  
  9807.                          c:\> alias wher*eis = dir /sp
  9808.  
  9809.                     the new command, WHEREIS, can be invoked as WHER,
  9810.                     WHERE, WHEREI, or WHEREIS.  Now if you type:
  9811.  
  9812.                          c:\> where myfile.txt
  9813.  
  9814.                     The WHEREIS alias will be expanded to the command:
  9815.  
  9816.                          dir /sp myfile.txt
  9817.  
  9818.  
  9819.                     Keystroke Aliases
  9820.  
  9821.                     If you want to assign an alias to a keystroke, use the
  9822.                     keyname on the left side of the equal sign, preceded
  9823.                     by an at sign [@].  For example, to assign the command
  9824.                     DIR /W to the F5 key, type
  9825.  
  9826.                          c:\> alias @F5 = dir /w
  9827.  
  9828.                     See page 31 for a complete listing of key names and a
  9829.                     description of the key name format.
  9830.  
  9831.                     When you define keystroke aliases, the assignments
  9832.                     will only be in effect at the command line, not inside
  9833.                     application programs.  Be careful not to assign
  9834.                     aliases to keys that are already used at the command
  9835.                     line (like F1 for Help).  The command-line meanings
  9836.                     take precedence and the keystroke alias will never be
  9837.                     invoked.  If you want to use one of the command-line
  9838.                     keys for an alias instead of its normal meaning, you
  9839.                     must first disable its regular use with the NormalKey
  9840.                     or NormalEditKey directive in your .INI file.  See
  9841.                     page 143 for instructions.
  9842.  
  9843.  
  9844.         -------------------------------------------------------------------
  9845.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 165
  9846.                                                                       ALIAS
  9847.         -------------------------------------------------------------------
  9848.  
  9849.  
  9850.                     If you define a keystroke alias with a single at sign
  9851.                     as shown above, then, when you press the F5 key, the
  9852.                     value of the alias (DIR /W above) will be placed on
  9853.                     the command line for you.  You can type additional
  9854.                     parameters if you wish and then press Enter to execute
  9855.                     the command.  With this particular alias, you can
  9856.                     define the files that you want to display after
  9857.                     pressing F5 and before pressing Enter to execute the
  9858.                     command.
  9859.  
  9860.                     If you want the keystroke alias to take action
  9861.                     automatically without waiting for you to edit the
  9862.                     command line or press Enter, you can begin the
  9863.                     definition with two at signs [@@].  The command
  9864.                     processor will execute the alias "silently," without
  9865.                     displaying its text on the command line.  For example,
  9866.                     this command will assign an alias to the F6 key that
  9867.                     uses the CDD command to take you back to the previous
  9868.                     default directory:
  9869.  
  9870.                          c:\> alias @@f6 = cdd -
  9871.  
  9872.                ##   A second method can also be used to make a keystroke
  9873.                     alias execute immediately:  you can include a carriage
  9874.                     return character as the last character in the alias
  9875.                     definition.  When the command processor finds the
  9876.                     carriage return, it executes the alias just as if you
  9877.                     had pressed the Enter key.  Unlike the "@@" method
  9878.                     (above), this method will display the contents of the
  9879.                     alias on the screen.  If you use this method, do not
  9880.                     define the alias with a double at sign as well.  If
  9881.                     you do, the alias will not work properly.
  9882.  
  9883.                     To include the carriage return character, add an
  9884.                     escape character followed by an "r" to the end of the
  9885.                     alias (see page 73 for more information about the
  9886.                     escape character).  For example, you could write the
  9887.                     above alias as:
  9888.  
  9889.                          c:\> alias @f6 = `cdd -<Ctrl-X>r`
  9890.  
  9891.                     (If you define your alias at the command line without
  9892.                     using back-quotes, you must use two escape characters
  9893.                     before the "r".  In 4DOS, the default escape character
  9894.                     is <Ctrl-X>; in 4OS2 and 4DOS/NT, the default escape
  9895.                     character is a caret [^].)
  9896.  
  9897.                ##   You can also define a keystroke alias by using "@" or
  9898.                     "@@" plus a scan code for one of the permissible keys
  9899.                     (see Appendix B on page 371 for a list of scan codes).
  9900.  
  9901.         -------------------------------------------------------------------
  9902.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 166
  9903.                                                                       ALIAS
  9904.         -------------------------------------------------------------------
  9905.  
  9906.  
  9907.                     In most cases it will be easier to use key names.
  9908.                     Scan codes should only be used with unusual keyboards
  9909.                     where a key name is not available for the key you are
  9910.                     using.
  9911.  
  9912.  
  9913.                     Displaying Aliases
  9914.  
  9915.                     If you want to see a list of all current ALIAS
  9916.                     commands, type:
  9917.  
  9918.                          c:\> alias
  9919.  
  9920.                     You can also view the definition of a single alias.
  9921.                     If you want to see the definition of the alias LIST,
  9922.                     you can type:
  9923.  
  9924.                          c:\> alias list
  9925.  
  9926.  
  9927.                     Saving and Reloading Your Aliases
  9928.  
  9929.                     You can save your aliases to a file called ALIAS.LST
  9930.                     this way:
  9931.  
  9932.                          c:\> alias > alias.lst
  9933.  
  9934.                     You can then reload all the alias definitions in the
  9935.                     file the next time you boot up with the command:
  9936.  
  9937.                          c:\> alias /r alias.lst
  9938.  
  9939.                     This is much faster than defining each alias
  9940.                     individually in a batch file.  If you keep your alias
  9941.                     definitions in a separate file which you load when
  9942.                     your system starts, you can edit them with a text
  9943.                     editor, reload the edited file with ALIAS /R, and know
  9944.                     that the same alias list will be loaded the next time
  9945.                     you boot your computer.
  9946.  
  9947.                     When you define aliases in a file that will be read
  9948.                     with the ALIAS /R command, you do not need back-quotes
  9949.                     around the value, even if back-quotes would normally
  9950.                     be required when defining the same alias at the
  9951.                     command line or in a batch file.
  9952.  
  9953.                     To remove an alias, use the UNALIAS command.
  9954.  
  9955.  
  9956.  
  9957.  
  9958.         -------------------------------------------------------------------
  9959.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 167
  9960.                                                                       ALIAS
  9961.         -------------------------------------------------------------------
  9962.  
  9963.  
  9964.                     Alias Parameters
  9965.  
  9966.                ##   Aliases can use command-line arguments or parameters
  9967.                     like those in batch files.  The command-line arguments
  9968.                     are numbered from %0 to %127.  %0 contains the alias
  9969.                     name.  It is up to the alias to determine the meaning
  9970.                     of the other parameters.  You can use quotation marks
  9971.                     to pass spaces, tabs, commas, and other special
  9972.                     characters in an alias parameter; see page 123 for
  9973.                     details.
  9974.  
  9975.                     Parameters that are referred to in an alias, but which
  9976.                     are missing on the command line, appear as empty
  9977.                     strings inside the alias.  For example, if you put two
  9978.                     parameters on the command line, any reference in the
  9979.                     alias to %3 or any higher-numbered parameter will be
  9980.                     interpreted as an empty string.
  9981.  
  9982.                     The parameter %n& has a special meaning.  4DOS
  9983.                     interprets it to mean "the entire command line, from
  9984.                     argument n to the end."  If n is not specified, it has
  9985.                     a default value of 1, so %& means "the entire command
  9986.                     line after the alias name."  4OS2 and 4DOS/NT normally
  9987.                     use a dollar sign [$] instead of an ampersand [&] to
  9988.                     indicate the remainder of the command tail (for
  9989.                     example, use %$ to refer to all parameters under 4OS2
  9990.                     or 4DOS/NT).  The special parameter %# contains the
  9991.                     number of command-line arguments.
  9992.  
  9993.                     For example, the following alias will change
  9994.                     directories, perform a command, and return to the
  9995.                     original directory:
  9996.  
  9997.                          c:\> alias in `pushd %1 ^ %2& ^ popd`
  9998.  
  9999.                     When this alias is invoked as:
  10000.  
  10001.                          c:\> in c:\comm mycomm /xmodem /2400
  10002.  
  10003.                     the first parameter, %1, has the value c:\comm.  %2 is
  10004.                     mycomm, %3 is /xmodem, and %4 is /2400.  The command
  10005.                     line expands into these three separate commands:
  10006.  
  10007.                          pushd c:\comm
  10008.                          mycomm /xmodem /2400
  10009.                          popd
  10010.  
  10011.                ##   This next example uses the IFF command to redefine the
  10012.                     defaults for SET.  It should be entered on one line:
  10013.  
  10014.  
  10015.         -------------------------------------------------------------------
  10016.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 168
  10017.                                                                       ALIAS
  10018.         -------------------------------------------------------------------
  10019.  
  10020.  
  10021.                          c:\> alias set = `iff %# == 0 then ^ *set /p
  10022.                               ^ else ^ *set %& ^ endiff`
  10023.  
  10024.                     This modifies the SET command so that if SET is
  10025.                     entered with no arguments, it is replaced by SET /P
  10026.                     (pause after displaying each page), but if SET is
  10027.                     followed by an argument, it behaves normally.  Note
  10028.                     the use of asterisks (*set) to prevent alias loops.
  10029.  
  10030.                ##   If an alias uses parameters, command-line arguments
  10031.                     will be deleted up to and including the highest
  10032.                     referenced argument.  For example, if an alias refers
  10033.                     only to %1 and %4, then the first and fourth arguments
  10034.                     will be used, the second and third arguments will be
  10035.                     discarded, and any additional arguments beyond the
  10036.                     fourth will be appended to the expanded command (after
  10037.                     the value portion of the alias).  If an alias uses no
  10038.                     parameters, all of the command-line arguments will be
  10039.                     appended to the expanded command.
  10040.  
  10041.                ##   Aliases also have full access to all variables in the
  10042.                     environment, internal variables, and variable
  10043.                     functions.  For example, you can create a simple
  10044.                     command-line calculator this way (enter this on one
  10045.                     line):
  10046.  
  10047.                          c:\> alias calc = `echo The answer is:
  10048.                          %@eval[%&]`
  10049.  
  10050.                     Now, if you enter:
  10051.  
  10052.                          c:\> calc 5 * 6
  10053.  
  10054.                     the alias will display:
  10055.  
  10056.                          The answer is: 30
  10057.  
  10058.  
  10059.                  ## Local and Global Aliases
  10060.  
  10061.                     The aliases can be stored in either a "local" or
  10062.                     "global" list.
  10063.  
  10064.                     With a local alias list, any changes made to the
  10065.                     aliases will only affect the current copy of the
  10066.                     command processor.  They will not be visible in other
  10067.                     shells or other sessions.  A local alias list is the
  10068.                     default under 4DOS.
  10069.  
  10070.  
  10071.  
  10072.         -------------------------------------------------------------------
  10073.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 169
  10074.                                                                       ALIAS
  10075.         -------------------------------------------------------------------
  10076.  
  10077.  
  10078.                     With a global alias list, all copies of the command
  10079.                     processor will share the same alias list, and any
  10080.                     changes made to the aliases in one copy will affect
  10081.                     all other copies.  A global alias list is the default
  10082.                     for 4OS2 and 4DOS/NT.
  10083.  
  10084.                     You can control the type of alias list with the
  10085.                     LocalAliases directive in the .INI file (see page
  10086.                     134), and with the /L and /LA options of the START
  10087.                     command (see page 331).
  10088.  
  10089.                     There is no fixed rule for determining whether to use
  10090.                     a local or global alias list.  Depending on your work
  10091.                     style, you may find it most convenient to use one
  10092.                     type, or a mixture of types in different sessions or
  10093.                     shells.  We recommend that you start with the default
  10094.                     approach for your command processor, then modify it if
  10095.                     you find a situation where the default is not
  10096.                     convenient.
  10097.  
  10098.                     Whenever you start a secondary shell (see page 12)
  10099.                     which uses a local alias list, it inherits a copy of
  10100.                     the aliases from the previous shell.  However, any
  10101.                     changes to the alias made in the secondary shell will
  10102.                     affect only that shell.  If you want changes made in a
  10103.                     secondary shell to affect the previous shell, use a
  10104.                     global alias list in both shells.
  10105.  
  10106.            4DOS     If you select a global alias list for 4DOS running
  10107.                     under DOS, you can share the aliases among all copies
  10108.                     of 4DOS.  However, if you run 4DOS under OS/2, global
  10109.                     lists will apply within each DOS session, but will not
  10110.                     allow you to share aliases between different DOS
  10111.                     sessions.
  10112.  
  10113.  
  10114.           4OS2,  ## Retaining Global Aliases with SHRALIAS
  10115.           4NT
  10116.                     If you select a global alias list for 4OS2 or 4DOS/NT,
  10117.                     you can share the aliases among all copies of the
  10118.                     command processor running in any session.  When you
  10119.                     close all 4OS2 or 4DOS/NT sessions, the memory for the
  10120.                     global alias list is released, and a new, empty alias
  10121.                     list is created the next time you start 4OS2 or
  10122.                     4DOS/NT.
  10123.  
  10124.                     If you want the alias list to be retained in memory
  10125.                     even when no command processor session is running, you
  10126.                     need to load the SHRALIAS program, which performs this
  10127.                     service for both the global alias list and the global
  10128.  
  10129.         -------------------------------------------------------------------
  10130.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 170
  10131.                                                                       ALIAS
  10132.         -------------------------------------------------------------------
  10133.  
  10134.  
  10135.                     history list.  SHRALIAS is supplied with your copy of
  10136.                     4OS2 or 4DOS/NT.
  10137.  
  10138.                     To load SHRALIAS, simply run the SHRALIAS.EXE program,
  10139.                     which is normally installed in the same directory as
  10140.                     your command processor.  You may find it convenient to
  10141.                     load SHRALIAS from your 4START file (see page 85), or,
  10142.                     under OS/2, from your STARTUP.CMD (see your 4OS2
  10143.                     Introduction and Installation Guide for details on
  10144.                     STARTUP.CMD).
  10145.  
  10146.                     If you try to load SHRALIAS when there is no 4OS2 or
  10147.                     4DOS/NT session running with a global alias or history
  10148.                     list enabled, then SHRALIAS will not be able to find
  10149.                     the lists.  In this case it will display an error
  10150.                     message and exit.  If you load SHRALIAS more than
  10151.                     once, the second copy will detect the original copy,
  10152.                     display an error message, and exit.  The original copy
  10153.                     will remain loaded.
  10154.  
  10155.                     SHRALIAS runs as a "detached" process, which means it
  10156.                     does not have a screen display or accept keyboard
  10157.                     input.  It is shut down automatically when the
  10158.                     operating system shuts down.  To unload SHRALIAS
  10159.                     manually, run SHRALIAS.EXE with the parameter /U.
  10160.  
  10161.  
  10162.                  ## The UNKNOWN_CMD Alias
  10163.  
  10164.                     If you create an alias with the name UNKNOWN_CMD, it
  10165.                     will be executed any time the command processor would
  10166.                     normally issue an "Unknown command" error message.
  10167.                     This allows you to define your own handler for unknown
  10168.                     commands.  When the UNKNOWN_CMD alias is executed, the
  10169.                     command line which generated the error is passed to
  10170.                     the alias for possible processing.
  10171.  
  10172.                !    Use caution when you create the UNKNOWN_CMD alias.  If
  10173.                     it contains an unknown command, it will be called
  10174.                     repeatedly and the command processor will lock up in
  10175.                     an infinite loop.
  10176.  
  10177.         Options:    /P(ause):  This option is only effective when ALIAS is
  10178.                     used to display existing definitions.  It pauses the
  10179.                     display after each page and waits for a keystroke
  10180.                     before continuing (see page 50).
  10181.  
  10182.                     /R(ead file):  This option loads an alias list from a
  10183.                     file.  The format of the file is the same as that of
  10184.                     the ALIAS display:
  10185.  
  10186.         -------------------------------------------------------------------
  10187.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 171
  10188.                                                                       ALIAS
  10189.         -------------------------------------------------------------------
  10190.  
  10191.  
  10192.                               name=value
  10193.  
  10194.                     where name is the name of the alias and value is its
  10195.                     value.  You can use an equal sign [=] or space to
  10196.                     separate the name and value.  Back-quotes are not
  10197.                     required around the value.  You can add comments to
  10198.                     the file by starting each comment line with a colon
  10199.                     [:].  You can load multiple files with one ALIAS /R
  10200.                     command by placing the names on the command line,
  10201.                     separated by spaces:
  10202.  
  10203.                          c:\> alias /r alias1.lst alias2.lst
  10204.  
  10205.                     Each definition in an ALIAS /R file can be up to 511
  10206.                     characters long in 4DOS, or 2047 characters in 4OS2
  10207.                     and 4DOS/NT.  The definitions can span multiple lines
  10208.                     in the file if each line, except the last, is
  10209.                     terminated with an escape character (see page 73).
  10210.  
  10211.  
  10212.  
  10213.  
  10214.  
  10215.  
  10216.  
  10217.  
  10218.  
  10219.  
  10220.  
  10221.  
  10222.  
  10223.  
  10224.  
  10225.  
  10226.  
  10227.  
  10228.  
  10229.  
  10230.  
  10231.  
  10232.  
  10233.  
  10234.  
  10235.  
  10236.  
  10237.  
  10238.  
  10239.  
  10240.  
  10241.  
  10242.  
  10243.         -------------------------------------------------------------------
  10244.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 172
  10245.                                                                      ATTRIB
  10246.         -------------------------------------------------------------------
  10247.  
  10248.  
  10249.         ATTRIB                                                   (Enhanced)
  10250.  
  10251.         Purpose:    Change or view file and subdirectory attributes.
  10252.  
  10253.         Format:     ATTRIB [/A[[:][-]rhsda] /D /P /Q /S] [+|-[AHRS]] files
  10254.                     ...
  10255.  
  10256.                     files:  A file, directory, or list of files or
  10257.                     directories on which to operate.
  10258.  
  10259.                     /A(ttribute select)      /Q(uiet)
  10260.                     /D(irectories)           /S(ubdirectories)
  10261.                     /P(ause)
  10262.  
  10263.                     Attribute flags:
  10264.  
  10265.                           A+    Set the archive attribute
  10266.                           A-    Clear the archive attribute
  10267.                           H+    Set the hidden attribute
  10268.                           H-    Clear the hidden attribute
  10269.                           R+    Set the read-only attribute
  10270.                           R-    Clear the read-only attribute
  10271.                           S+    Set the system attribute
  10272.                           S-    Clear the system attribute
  10273.  
  10274.         Selection:  Supports extended wildcards, ranges, multiple file
  10275.                     names, and include lists (see pages 59 - 67).
  10276.  
  10277.         Usage:      Every file and subdirectory has 4 attributes that can
  10278.                     be turned on (set) or turned off (cleared):  Archive,
  10279.                     Hidden, Read-only, and System.  For details on the
  10280.                     meaning of each attribute, see page 18.
  10281.  
  10282.                     The ATTRIB command lets you set or clear attributes
  10283.                     for any file, group of files, or subdirectory.  You
  10284.                     can view file attributes by entering ATTRIB without
  10285.                     specifying new attributes (i.e., without the [+|-
  10286.                     [AHRS]] part of the format), or with the DIR /T
  10287.                     command.
  10288.  
  10289.                     For example, you can set the read-only and hidden
  10290.                     attributes for the file MEMO:
  10291.  
  10292.                          c:\> attrib +rh memo
  10293.  
  10294.                     Attribute options apply to the file(s) that follow the
  10295.                     options on the ATTRIB command line.  The example below
  10296.                     shows how to set different attributes on different
  10297.                     files with a single command.  It sets the archive
  10298.                     attribute for all .TXT files, then sets the system
  10299.  
  10300.         -------------------------------------------------------------------
  10301.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 173
  10302.                                                                      ATTRIB
  10303.         -------------------------------------------------------------------
  10304.  
  10305.  
  10306.                     attribute and clears the archive attribute for
  10307.                     TEST.COM:
  10308.  
  10309.                          c:\> attrib +a *.txt +s -a test.com
  10310.  
  10311.                ##   Your operating system also supports "D" (subdirectory)
  10312.                     and "V" (volume label) attributes.  These attributes
  10313.                     cannot be altered with ATTRIB; they are designed to be
  10314.                     controlled only by the operating system itself.
  10315.  
  10316.         Options: ## /A(ttribute select): Select only those files that have
  10317.                     the specified attribute(s) set.  Preceding the
  10318.                     attribute character with a hyphen [-] will select
  10319.                     files that do not have that attribute set.  The
  10320.                     attributes are:
  10321.  
  10322.                          R    Read-only         D    Subdirectory
  10323.                          H    Hidden            A    Archive
  10324.                          S    System
  10325.  
  10326.                     If no attributes are listed at all (e.g., ATTRIB /A
  10327.                     ...), ATTRIB will select all files and subdirectories
  10328.                     including hidden and system files.  If attributes are
  10329.                     combined, all the specified attributes must match for
  10330.                     a file to be selected.  For example, /A:RHS will
  10331.                     select only those files with all three attributes set.
  10332.                     See page 18 for more information on file attributes.
  10333.  
  10334.                     /D(irectories):  If you use the /D option, ATTRIB will
  10335.                     modify the attributes of subdirectories in addition to
  10336.                     files (yes, you can have a hidden subdirectory):
  10337.  
  10338.                          c:\> attrib /d +h c:\mydir
  10339.  
  10340.                     In addition, the /D option will keep ATTRIB from
  10341.                     appending "\*.*" to the end of a directory name and
  10342.                     modifying the attributes of all the files in the
  10343.                     subdirectory.
  10344.  
  10345.                     If you use a directory name instead of a file name,
  10346.                     and omit /D, ATTRIB will append "\*.*" to the end of
  10347.                     the name and act on all files in that directory,
  10348.                     rather than acting on the directory itself.
  10349.  
  10350.                     /P(ause):  Wait for a key to be pressed after each
  10351.                     screen page before continuing the display.  Your
  10352.                     options at the prompt are explained in detail on page
  10353.                     50.
  10354.  
  10355.  
  10356.  
  10357.         -------------------------------------------------------------------
  10358.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 174
  10359.                                                                      ATTRIB
  10360.         -------------------------------------------------------------------
  10361.  
  10362.  
  10363.                     /Q(uiet):  This option turns off ATTRIB's normal
  10364.                     screen output.  It is most useful in batch files.
  10365.  
  10366.                     /S(ubdirectories):  If you use the /S option, the
  10367.                     ATTRIB command will be applied to all matching files
  10368.                     in the current or named directory and all of its
  10369.                     subdirectories.
  10370.  
  10371.  
  10372.  
  10373.  
  10374.  
  10375.  
  10376.  
  10377.  
  10378.  
  10379.  
  10380.  
  10381.  
  10382.  
  10383.  
  10384.  
  10385.  
  10386.  
  10387.  
  10388.  
  10389.  
  10390.  
  10391.  
  10392.  
  10393.  
  10394.  
  10395.  
  10396.  
  10397.  
  10398.  
  10399.  
  10400.  
  10401.  
  10402.  
  10403.  
  10404.  
  10405.  
  10406.  
  10407.  
  10408.  
  10409.  
  10410.  
  10411.  
  10412.  
  10413.  
  10414.         -------------------------------------------------------------------
  10415.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 175
  10416.                                                                        BEEP
  10417.         -------------------------------------------------------------------
  10418.  
  10419.  
  10420.         BEEP                                                          (New)
  10421.  
  10422.         Purpose:    Beep the speaker or play simple music.
  10423.  
  10424.         Format:     BEEP [frequency duration ...]
  10425.  
  10426.                     frequency:  The beep frequency in Hertz (cycles per
  10427.                     second).
  10428.                     duration:  The beep length in 1/18th second intervals.
  10429.  
  10430.         Usage:      BEEP generates a sound through your computer's
  10431.                     speaker.  It is normally used in batch files to signal
  10432.                     that an operation has been completed, or that the
  10433.                     computer needs attention.
  10434.  
  10435.                     Because BEEP allows you to specify the frequency and
  10436.                     duration of the sound, you can also use it to play
  10437.                     simple music or to create different kinds of signals
  10438.                     for the user.
  10439.  
  10440.                     You can include as many frequency and duration pairs
  10441.                     as you wish.  No sound will be generated for
  10442.                     frequencies less than 20 Hz, allowing you to insert
  10443.                     short delays.  The default value for frequency is 440
  10444.                     Hz; the default value for duration is 2.
  10445.  
  10446.                     This batch file fragment runs a program called DEMO,
  10447.                     then plays a few notes and waits for you to press a
  10448.                     key:
  10449.  
  10450.                          demo ^ beep 440 4  600 2  1040 6
  10451.                          pause Finished with the demo - hit a key...
  10452.  
  10453.                     The following table gives the frequency values for a
  10454.                     five octave range (middle C is 262 Hz):
  10455.  
  10456.                          C      131   262   523   1046  2093
  10457.                          C#/Db  139   277   554   1108  2217
  10458.                          D      147   294   587   1174  2349
  10459.                          D#/Eb  156   311   622   1244  2489
  10460.                          E      165   330   659   1318  2637
  10461.                          F      175   349   698   1397  2794
  10462.                          F#/Gb  185   370   740   1480  2960
  10463.                          G      196   392   784   1568  3136
  10464.                          G#/Ab  208   415   831   1662  3322
  10465.                          A      220   440   880   1760  3520
  10466.                          A#/Bb  233   466   932   1864  3729
  10467.                          B      248   494   988   1976  3951
  10468.  
  10469.  
  10470.  
  10471.         -------------------------------------------------------------------
  10472.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 176
  10473.                                                   [4DOS, 4DOS/NT]     BREAK
  10474.         -------------------------------------------------------------------
  10475.  
  10476.  
  10477.         BREAK      [4DOS, 4DOS/NT]                             (Compatible)
  10478.  
  10479.         Purpose:    Display, enable, or disable Ctrl-C and Ctrl-Break
  10480.                     checking.
  10481.  
  10482.         Format:     BREAK [ON | OFF]
  10483.  
  10484.         Usage:      The Ctrl-C and Ctrl-Break keys are used by many
  10485.                     programs (including 4DOS) as a signal to interrupt the
  10486.                     current operation.  BREAK controls how often DOS
  10487.                     checks to see if you've entered one of these
  10488.                     keystrokes.
  10489.  
  10490.             4NT     Ctrl-C and Ctrl-Break checking cannot actually be
  10491.                     enabled or disabled under Windows NT.  4DOS/NT
  10492.                     supports BREAK as a "do-nothing" command, for
  10493.                     compatibility with CMD.EXE.  This avoids errors in
  10494.                     batch files which use the BREAK command.  The
  10495.                     additional discussion below applies only to 4DOS, not
  10496.                     to 4DOS/NT.
  10497.  
  10498.                     Normally, BREAK is turned off, and DOS only checks for
  10499.                     Ctrl-C and Ctrl-Break keystrokes during DOS input or
  10500.                     output operations involving the screen, keyboard,
  10501.                     serial port, and printer.  However, many programs
  10502.                     don't use DOS for these operations, and it can be
  10503.                     difficult to interrupt them.
  10504.  
  10505.                     When BREAK is turned on, DOS checks for Ctrl-C and
  10506.                     Ctrl-Break every time a program calls DOS.  Since most
  10507.                     programs use DOS to access files and perform other
  10508.                     functions, turning BREAK on makes it much more likely
  10509.                     that a Ctrl-C or Ctrl-Break will be noticed.  If you
  10510.                     turn BREAK on, programs will run slightly slower than
  10511.                     normal (the difference is not usually noticeable).
  10512.  
  10513.                     Turning BREAK on or off only affects when DOS detects
  10514.                     Ctrl-C and Ctrl-Break and notifies the program you're
  10515.                     running.  Any program can choose to ignore these
  10516.                     signals.  Also, any external program can change the
  10517.                     BREAK setting on its own.
  10518.  
  10519.                     Type BREAK plus ON or OFF to set the BREAK status, or
  10520.                     BREAK by itself to display the current BREAK status.
  10521.                     For example:
  10522.  
  10523.                          c:\> break on
  10524.                          c:\> break
  10525.                          BREAK is ON
  10526.  
  10527.  
  10528.         -------------------------------------------------------------------
  10529.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 177
  10530.                                                   [4DOS, 4DOS/NT]     BREAK
  10531.         -------------------------------------------------------------------
  10532.  
  10533.  
  10534.                     BREAK is off by default.  You can change the default
  10535.                     by adding a BREAK=ON command to your CONFIG.SYS file.
  10536.  
  10537.  
  10538.  
  10539.  
  10540.  
  10541.  
  10542.  
  10543.  
  10544.  
  10545.  
  10546.  
  10547.  
  10548.  
  10549.  
  10550.  
  10551.  
  10552.  
  10553.  
  10554.  
  10555.  
  10556.  
  10557.  
  10558.  
  10559.  
  10560.  
  10561.  
  10562.  
  10563.  
  10564.  
  10565.  
  10566.  
  10567.  
  10568.  
  10569.  
  10570.  
  10571.  
  10572.  
  10573.  
  10574.  
  10575.  
  10576.  
  10577.  
  10578.  
  10579.  
  10580.  
  10581.  
  10582.  
  10583.  
  10584.  
  10585.         -------------------------------------------------------------------
  10586.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 178
  10587.                                                                        CALL
  10588.         -------------------------------------------------------------------
  10589.  
  10590.  
  10591.         CALL                                                   (Compatible)
  10592.  
  10593.         Purpose:    Execute one batch file from within another.
  10594.  
  10595.         Format:     CALL file
  10596.  
  10597.                     file:  The batch file to execute.
  10598.  
  10599.                     See also CANCEL and QUIT.
  10600.  
  10601.         Usage:      CALL allows batch files to call other batch files
  10602.                     (batch file nesting).  The calling batch file is
  10603.                     suspended while the called (second) batch file runs.
  10604.                     When the second batch file finishes, the original
  10605.                     batch file resumes execution at the next command.  If
  10606.                     you execute a batch file from inside another batch
  10607.                     file without using CALL, the first batch file is
  10608.                     terminated before the second one starts.
  10609.  
  10610.                     The following batch file fragment compares an input
  10611.                     line to "wp" and calls another batch file if it
  10612.                     matches:
  10613.  
  10614.                          input  Enter your choice:  %%option
  10615.                          if "%option" == "wp" call wp.bat
  10616.  
  10617.                     4DOS, 4OS2, and 4DOS/NT support batch file nesting up
  10618.                     to ten levels deep.
  10619.  
  10620.                     The current ECHO state is inherited by a called batch
  10621.                     file.
  10622.  
  10623.                ##   A called batch file will return to the calling file
  10624.                     after processing the last line in the called file, or
  10625.                     when a QUIT command is executed.  A called batch file
  10626.                     should always return in this way, or terminate all
  10627.                     batch files with CANCEL.  Restarting (or CALLing) the
  10628.                     original batch file from within a called file will
  10629.                     prevent the command processor from detecting that
  10630.                     you've left the second file, and it may cause an
  10631.                     infinite loop or a stack overflow.
  10632.  
  10633.                ##   CALL returns an exit code which matches the batch file
  10634.                     return code.  You can test this exit code with the %_?
  10635.                     or %? environment variable (see page 102), and use it
  10636.                     with conditional commands (&& and ||; see page 71).
  10637.  
  10638.  
  10639.  
  10640.  
  10641.  
  10642.         -------------------------------------------------------------------
  10643.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 179
  10644.                                                                      CANCEL
  10645.         -------------------------------------------------------------------
  10646.  
  10647.  
  10648.         CANCEL                                                        (New)
  10649.  
  10650.         Purpose:    Terminate batch file processing.
  10651.  
  10652.         Format:     CANCEL  [value]
  10653.  
  10654.                     value:  The exit code from 0 to 255 to return to the
  10655.                     command processor.
  10656.  
  10657.                     See also:  CALL and QUIT.
  10658.  
  10659.         Usage:      The CANCEL command ends all batch file processing,
  10660.                     regardless of the batch file nesting level.  Use QUIT
  10661.                     to end a nested batch file and return to the previous
  10662.                     batch file.
  10663.  
  10664.                     You can CANCEL at any point in a batch file.  If
  10665.                     CANCEL is used from within an alias it will end
  10666.                     execution of both the alias and any batch file(s)
  10667.                     which are running at the time.
  10668.  
  10669.                     The following batch file fragment compares an input
  10670.                     line to "end" and terminates all batch file processing
  10671.                     if it matches:
  10672.  
  10673.                          input Enter your choice:  %%option
  10674.                          if "%option" == "end" cancel
  10675.  
  10676.                ##   If you specify a value, CANCEL will set the ERRORLEVEL
  10677.                     or exit code to that value (see the IF command, and
  10678.                     the %? variable on page 102).
  10679.  
  10680.  
  10681.  
  10682.  
  10683.  
  10684.  
  10685.  
  10686.  
  10687.  
  10688.  
  10689.  
  10690.  
  10691.  
  10692.  
  10693.  
  10694.  
  10695.  
  10696.  
  10697.  
  10698.  
  10699.         -------------------------------------------------------------------
  10700.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 180
  10701.                                                                  CD / CHDIR
  10702.         -------------------------------------------------------------------
  10703.  
  10704.  
  10705.         CD / CHDIR                                               (Enhanced)
  10706.  
  10707.         Purpose:    Display or change the current directory.
  10708.  
  10709.         Format:     CD [ path | - ]
  10710.                          or
  10711.                     CHDIR [ path | - ]
  10712.  
  10713.                     path:  The directory to change to, including an
  10714.                     optional drive name.
  10715.  
  10716.                     See also:  CDD, MD, PUSHD, RD, and Directory Changes
  10717.                     on page 44.
  10718.  
  10719.         Usage:      CD and CHDIR are synonyms.  You can use either one.
  10720.  
  10721.                     CD lets you navigate through the DOS subdirectory
  10722.                     structure by changing the current working directory.
  10723.                     If you enter CD and a directory name, the named
  10724.                     directory becomes the new current directory.  For
  10725.                     example, to change to the subdirectory
  10726.                     C:\FINANCE\MYFILES:
  10727.  
  10728.                          c:\> cd \finance\myfiles
  10729.                          c:\finance\myfiles>
  10730.  
  10731.                     Every disk drive on the system has its own current
  10732.                     directory.  Specifying both a drive and a directory in
  10733.                     the CD command will change the current directory on
  10734.                     the specified drive, but will not change the default
  10735.                     drive.  For example, to change the default directory
  10736.                     on drive A:
  10737.  
  10738.                          c:\> cd a:\utility
  10739.                          c:\>
  10740.  
  10741.                     Notice that this command does not change to drive A:.
  10742.                     Use the CDD command to change the current drive and
  10743.                     directory at the same time.
  10744.  
  10745.                     You can change to the parent directory with CD ..; you
  10746.                     can also go up one additional directory level with
  10747.                     each additional [.].  For example, CD .... will go up
  10748.                     three levels in the directory tree (see page 59 for
  10749.                     additional details).  You can move to a sibling
  10750.                     directory - one that branches from the same parent
  10751.                     directory as the current subdirectory - with a command
  10752.                     like CD ..\newdir.
  10753.  
  10754.  
  10755.  
  10756.         -------------------------------------------------------------------
  10757.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 181
  10758.                                                                  CD / CHDIR
  10759.         -------------------------------------------------------------------
  10760.  
  10761.  
  10762.                     If you enter CD with no argument or with only a disk
  10763.                     drive name, it will display the current directory on
  10764.                     the default or named drive.
  10765.  
  10766.                     CD saves the current directory before changing to a
  10767.                     new directory.  You can switch back to the previous
  10768.                     directory by entering CD -.  (There must be a space
  10769.                     between the CD command and the hyphen.)  You can
  10770.                     switch back and forth between two directories by
  10771.                     repeatedly entering CD -.  The saved directory is the
  10772.                     same for both the CD and CDD commands.  Drive changes
  10773.                     and automatic directory changes (see page 47) also
  10774.                     modify the saved directory, so you can use CD - to
  10775.                     return to a directory that you exited with an
  10776.                     automatic directory change.
  10777.  
  10778.                     Directory changes made with CD are recorded for
  10779.                     display in the directory history window (see page 45).
  10780.  
  10781.                ##   CD never changes the default drive.  If you change
  10782.                     directories on one drive, switch to another drive, and
  10783.                     then enter CD -, the directory will be restored on the
  10784.                     first drive but the current drive will not be changed.
  10785.  
  10786.                ##   If CD can't change to the specified directory, it will
  10787.                     look for the CDPATH environment variable.  See page 44
  10788.                     for details about using CDPATH.
  10789.  
  10790.                     The operating system limits the permissible length of
  10791.                     the full subdirectory name.  See page 15 for more
  10792.                     information on directory names.
  10793.  
  10794.  
  10795.  
  10796.  
  10797.  
  10798.  
  10799.  
  10800.  
  10801.  
  10802.  
  10803.  
  10804.  
  10805.  
  10806.  
  10807.  
  10808.  
  10809.  
  10810.  
  10811.  
  10812.  
  10813.         -------------------------------------------------------------------
  10814.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 182
  10815.                                                                         CDD
  10816.         -------------------------------------------------------------------
  10817.  
  10818.  
  10819.         CDD                                                           (New)
  10820.  
  10821.         Purpose:    Change the current disk drive and directory.
  10822.  
  10823.         Format:     CDD path
  10824.  
  10825.                     path:  The name of the directory (or drive and
  10826.                     directory) to change to.
  10827.  
  10828.                     See also:  CD, MD, PUSHD, RD, and Directory Changes on
  10829.                     page 44.
  10830.  
  10831.         Usage:      CDD is similar to the CD command, except that it also
  10832.                     changes the default disk drive if one is specified.
  10833.                     CDD will change to the directory and drive you name.
  10834.                     To change from the root directory on drive A to the
  10835.                     subdirectory C:\WP:
  10836.  
  10837.                          a:\> cdd c:\wp
  10838.                          c:\wp>
  10839.  
  10840.                     You can change to the parent directory with CDD ..;
  10841.                     you can also go up one additional directory level with
  10842.                     each additional [.].  For example, CDD .... will go up
  10843.                     three levels in the directory tree.
  10844.  
  10845.                     CDD saves the current drive and directory before
  10846.                     changing to a new directory.  You can switch back to
  10847.                     the previous drive and directory by entering CDD -.
  10848.                     (There must be a space between the CDD command and the
  10849.                     hyphen.)  You can switch back and forth between two
  10850.                     drives and directories by repeatedly entering CDD -.
  10851.                     The saved directory is the same for both the CD and
  10852.                     CDD commands.  Drive changes and automatic directory
  10853.                     changes (see page 47) also modify the saved directory,
  10854.                     so you can use CDD - to return to a directory that you
  10855.                     exited with a drive change or an automatic directory
  10856.                     change.
  10857.  
  10858.                     Directory changes made with CDD are recorded for
  10859.                     display in the directory history window (see page 45).
  10860.  
  10861.                ##   If CDD can't change to the specified directory, it
  10862.                     will look for the CDPATH environment variable.  See
  10863.                     page 44 for details about using CDPATH.
  10864.  
  10865.                     The operating system limits the permissible length of
  10866.                     the full subdirectory name.  See page 15 for more
  10867.                     information on directory names.
  10868.  
  10869.  
  10870.         -------------------------------------------------------------------
  10871.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 183
  10872.                                                       [4DOS, 4OS2]     CHCP
  10873.         -------------------------------------------------------------------
  10874.  
  10875.  
  10876.         CHCP      [4DOS, 4OS2]                                 (Compatible)
  10877.  
  10878.         Purpose:    Display or change the current system code page.
  10879.  
  10880.         Format:     CHCP [n]
  10881.  
  10882.                     n:  A system code page number.
  10883.  
  10884.         ## Usage:   Code page switching allows you to select different
  10885.                     character sets for language support.  To use code page
  10886.                     switching, you must have an EGA or VGA display and be
  10887.                     running under MS-DOS or PC-DOS 3.3 or above, or OS/2.
  10888.                     CHCP is not available in 4DOS/NT.
  10889.  
  10890.                     If you enter CHCP without a number, the current code
  10891.                     page is displayed.
  10892.  
  10893.                          c:\> chcp
  10894.                          Active code page: 437
  10895.  
  10896.                     If you enter CHCP plus a code page number, the system
  10897.                     code page is changed.  For example, to set the code
  10898.                     page to multilingual:
  10899.  
  10900.                          c:\> chcp 850
  10901.  
  10902.             4DOS    Before using CHCP under DOS, you must first load the
  10903.                     device drivers (in CONFIG.SYS), make sure the
  10904.                     information file (COUNTRY.SYS) is available, load
  10905.                     national language support (using the NLSFUNC command),
  10906.                     and prepare the specified code page for the devices
  10907.                     (using the MODE command with the CODEPAGE PREPARE
  10908.                     option).
  10909.  
  10910.                     CHCP accepts one of the prepared system code pages.
  10911.                     An error message is displayed if a code page is
  10912.                     selected that has not been prepared for the system.
  10913.  
  10914.                     See your DOS or OS/2 documentation for more
  10915.                     information on CHCP.
  10916.  
  10917.  
  10918.  
  10919.  
  10920.  
  10921.  
  10922.  
  10923.  
  10924.  
  10925.  
  10926.  
  10927.         -------------------------------------------------------------------
  10928.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 184
  10929.                                                                         CLS
  10930.         -------------------------------------------------------------------
  10931.  
  10932.  
  10933.         CLS                                                      (Enhanced)
  10934.  
  10935.         Purpose:    Clear the video display and move the cursor to the
  10936.                     upper left corner; optionally change the default
  10937.                     display and border colors.
  10938.  
  10939.         Format:     CLS [[BRIght] [BLInk] fg ON [BRIght] bg] [BORder bc]
  10940.  
  10941.                     fg:  The new foreground color
  10942.                     bg:  The new background color
  10943.                     bc:  The new border color
  10944.  
  10945.         Usage:      CLS can be used to clear the screen without changing
  10946.                     colors, or to clear the screen and change the screen
  10947.                     colors simultaneously.  These three examples show how
  10948.                     to clear the screen to the default colors, to bright
  10949.                     white letters on a blue background, and to bright
  10950.                     yellow letters on a magenta background with a blue
  10951.                     border:
  10952.  
  10953.                          c:\> cls
  10954.                          c:\> cls bright white on blue
  10955.                          c:\> cls bri yel on mag bor blu
  10956.  
  10957.                     CLS is often used in batch files to clear the screen
  10958.                     before displaying text.
  10959.  
  10960.                     See page 26 for details about colors and color names,
  10961.                     and notes on the use of bright background colors.
  10962.  
  10963.             4DOS ## Under DOS, if ANSI.SYS or a compatible driver is not
  10964.                     loaded, the colors will not be "sticky" - you may lose
  10965.                     them after you run an application.  If 4DOS thinks you
  10966.                     have an ANSI driver loaded, it uses an ANSI clear
  10967.                     screen command.  Otherwise, 4DOS will call the BIOS to
  10968.                     clear the screen.  You can force 4DOS to recognize the
  10969.                     proper ANSI state with the SETDOS /A option (see page
  10970.                     323) or the ANSI directive in 4DOS.INI (see page 137).
  10971.  
  10972.             4DOS ## If your display accommodates more than 25 rows by 80
  10973.                     columns and CLS doesn't clear the whole screen, your
  10974.                     ANSI driver probably does not support the large
  10975.                     display size properly.
  10976.  
  10977.  
  10978.  
  10979.  
  10980.  
  10981.  
  10982.  
  10983.  
  10984.         -------------------------------------------------------------------
  10985.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 185
  10986.                                                                       COLOR
  10987.         -------------------------------------------------------------------
  10988.  
  10989.  
  10990.         COLOR                                                         (New)
  10991.  
  10992.         Purpose:    Change the default display colors.
  10993.  
  10994.         Format:     COLOR [BRIght] [BLInk] fg ON [BRIght] bg [BORder bc]
  10995.  
  10996.                     fg:  The new foreground color
  10997.                     bg:  The new background color
  10998.                     bc:  The new border color
  10999.  
  11000.                     See also:  CLS, and page 26 for details about using
  11001.                     colors.
  11002.  
  11003.         Usage:      COLOR is normally used in batch files before
  11004.                     displaying text.  For example, to set screen colors to
  11005.                     bright white on blue, you can use this command:
  11006.  
  11007.                          c:\> color bright white on blue
  11008.  
  11009.             4DOS    If you have an ANSI driver (such as ANSI.SYS)
  11010.                     installed, COLOR will not change anything on the
  11011.                     screen.  It will only set the default colors for
  11012.                     subsequent screen displays.  If you are not using an
  11013.                     ANSI driver, COLOR will change the display colors of
  11014.                     every character on the screen.  However, the colors
  11015.                     will not be "sticky" - you may lose them after you run
  11016.                     an application.
  11017.  
  11018.             4DOS ## If you see odd characters like "[44;37m" when you try
  11019.                     to set the screen colors, 4DOS probably thinks you
  11020.                     have an ANSI driver loaded when you don't.  Use SETDOS
  11021.                     /A2, or ANSI = No in 4DOS.INI, to tell 4DOS you have
  11022.                     no ANSI driver.
  11023.  
  11024.  
  11025.  
  11026.  
  11027.  
  11028.  
  11029.  
  11030.  
  11031.  
  11032.  
  11033.  
  11034.  
  11035.  
  11036.  
  11037.  
  11038.  
  11039.  
  11040.  
  11041.         -------------------------------------------------------------------
  11042.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 186
  11043.                                                                        COPY
  11044.         -------------------------------------------------------------------
  11045.  
  11046.  
  11047.         COPY                                                     (Enhanced)
  11048.  
  11049.         Purpose:    Copy data between disks, directories, files, or
  11050.                     physical hardware devices (such as your printer or
  11051.                     serial port).
  11052.  
  11053.         Format:     COPY [/A:[[-]rhsda] /C /H /M /N /P /Q /R /S /T /U /V]
  11054.                          source[+] ... [/A /B] destination [/A /B]
  11055.  
  11056.                     source:  A file or list of files or a device to copy
  11057.                     from.
  11058.                     destination:  A file, directory, or device to copy to.
  11059.  
  11060.                     /A(SCII)                 /P(rompt)
  11061.                     /A:(ttribute select)     /Q(uiet)
  11062.                     /B(inary)                /R(eplace)
  11063.                     /C(hanged)               /S(ubdirectories)
  11064.                     /H(idden)                /T(otals)
  11065.                     /M(odified)              /U(pdate)
  11066.                     /N(othing)               /V(erify)
  11067.  
  11068.                     See also:  ATTRIB, MOVE, and REN.
  11069.  
  11070.         Selection:  Supports extended wildcards, ranges, multiple file
  11071.                     names, and include lists (see pages 59 - 67).  Date,
  11072.                     time, or size ranges anywhere on the line apply to all
  11073.                     source files.
  11074.  
  11075.         Usage:      The COPY command accepts all traditional syntax and
  11076.                     options and adds several new features.
  11077.  
  11078.                     The simplest use of COPY is to make a copy of a file,
  11079.                     like this example which makes a copy of a file called
  11080.                     FILE1.ABC:
  11081.  
  11082.                          c:\> copy file1.abc file2.def
  11083.  
  11084.                     You can also copy a file to another drive and/or
  11085.                     directory.  The following command copies FILE1 to the
  11086.                     \MYDIR directory on drive E:
  11087.  
  11088.                          c:\> copy file1 e:\mydir
  11089.  
  11090.                     You can copy several files at once by using wildcards:
  11091.  
  11092.                          c:\> copy *.txt e:\mydir
  11093.  
  11094.                     (See page 59 for an explanation of how 4DOS interprets
  11095.                     the wildcard characters [*] and [?].)
  11096.  
  11097.  
  11098.         -------------------------------------------------------------------
  11099.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 187
  11100.                                                                        COPY
  11101.         -------------------------------------------------------------------
  11102.  
  11103.  
  11104.                     You can also list several source files in one command.
  11105.                     The following command copies 3 files from the current
  11106.                     directory to the \MYDIR directory on drive E:
  11107.  
  11108.                          c:\> copy file1 file2 file3 e:\mydir
  11109.  
  11110.                     The way COPY interprets your command line depends on
  11111.                     how many arguments (file, directory, or device names)
  11112.                     are on the line, and whether the arguments are
  11113.                     separated with [+] signs or spaces.
  11114.  
  11115.                     If there is only one argument on the line, COPY
  11116.                     assumes it is the source, and uses the current drive
  11117.                     and directory as the destination.  For example, the
  11118.                     following command copies all the .DAT files on drive A
  11119.                     to the current directory on drive C:
  11120.  
  11121.                          c:\> copy a:*.dat
  11122.  
  11123.                     If there are two or more arguments on the line and [+]
  11124.                     signs are not used, then COPY assumes that the last
  11125.                     argument is the destination and copies all source
  11126.                     files to this new location.  If the destination is a
  11127.                     drive, directory, or device name then the source files
  11128.                     are copied individually to the new location.  If the
  11129.                     destination is a file name, the first source file is
  11130.                     copied to the destination, and any additional source
  11131.                     files are then appended to the new destination file.
  11132.  
  11133.                     For example, the first of these commands copies the
  11134.                     .DAT files from the current directory on drive A
  11135.                     individually to C:\MYDIR (which must already exist as
  11136.                     a directory); the second appends all the .DAT files
  11137.                     together into one large file called C:\DATA (assuming
  11138.                     C:\DATA is not a directory):
  11139.  
  11140.                          c:>\ copy a:*.dat c:\mydir\
  11141.                          c:>\ copy a:*.dat c:\data
  11142.  
  11143.                     When you copy to a directory, if you add a backslash
  11144.                     [\] to the end of the name as shown in the first
  11145.                     example above, COPY will display an error message if
  11146.                     the name does not refer to an existing directory.  You
  11147.                     can use this feature to keep COPY from treating a
  11148.                     mistyped destination directory name as a file name and
  11149.                     attempting to append all your source files to a
  11150.                     destination file, when you really meant to copy them
  11151.                     individually to a destination directory.
  11152.  
  11153.  
  11154.  
  11155.         -------------------------------------------------------------------
  11156.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 188
  11157.                                                                        COPY
  11158.         -------------------------------------------------------------------
  11159.  
  11160.  
  11161.                ##   A plus [+] tells COPY to append two or more files to a
  11162.                     single destination file.  If you list several source
  11163.                     files separated with [+] and don't specify a
  11164.                     destination, COPY will use the name of the first
  11165.                     source file as the destination, and append each
  11166.                     subsequent file to the first file.  In this case the
  11167.                     destination file will always be created in the current
  11168.                     directory, even if the first source file is in another
  11169.                     directory or on another drive.
  11170.  
  11171.                     For example, the following command will append the
  11172.                     contents of C:\MEMO2 and C:\MEMO3 to C:\MEMO1 and
  11173.                     leave the combined contents in the file named
  11174.                     C:\MEMO1:
  11175.  
  11176.                          c:\> copy memo1+memo2+memo3
  11177.  
  11178.                     To append the same three files but store the result in
  11179.                     BIGMEMO:
  11180.  
  11181.                          c:\> copy memo1+memo2+memo3 bigmemo
  11182.  
  11183.                     To append C:\MEM\MEMO2 and C:\MEM\MEMO3 to
  11184.                     D:\DATA\MEMO1, and leave the result in C:\MEM\MEMO1:
  11185.  
  11186.                          c:\mem> copy d:\data\memo1+memo2+memo3
  11187.  
  11188.                ##   You cannot append files to a device (such as a
  11189.                     printer); if you try to do so, COPY will ignore the
  11190.                     [+] signs and copy the files individually.  If you
  11191.                     attempt to append several source files to a
  11192.                     destination directory or disk, COPY will append the
  11193.                     files and place the copy in the new location with the
  11194.                     same name as the first source file.
  11195.  
  11196.                ##   If your destination has wildcards in it, COPY will
  11197.                     attempt to match them with the source names.  For
  11198.                     example, this command copies the .DAT files from drive
  11199.                     A to C:\MYDIR and gives the new copies the extension
  11200.                     .DX:
  11201.  
  11202.                          c:\> copy a:*.dat c:\mydir\*.dx
  11203.  
  11204.                     This feature can give you unexpected results if you
  11205.                     use it with multiple source file names.  For example,
  11206.                     suppose that drive A contains XYZ.DAT and XYZ.TXT.
  11207.                     The command
  11208.  
  11209.                          c:\> copy a:\*.dat a:\*.txt c:\mydir\*.dx
  11210.  
  11211.  
  11212.         -------------------------------------------------------------------
  11213.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 189
  11214.                                                                        COPY
  11215.         -------------------------------------------------------------------
  11216.  
  11217.  
  11218.                     will copy A:XYZ.DAT to C:\MYDIR\XYZ.DX.  Then it will
  11219.                     copy A:XYZ.TXT to C:\MYDIR\XYZ.DX, overwriting the
  11220.                     first file it copied.
  11221.  
  11222.                ##   COPY also understands include lists (see page 67), so
  11223.                     you can specify several different kinds of files in
  11224.                     the same command.  This command copies the .TXT, .DOC,
  11225.                     and .BAT files from the E:\MYDIR directory to the root
  11226.                     directory of drive A:
  11227.  
  11228.                          c:\> copy e:\mydir\*.txt;*.doc;*.bat a:\
  11229.  
  11230.                ##   You can use date, time, and size ranges to further
  11231.                     define the files that you want to copy (see page 62
  11232.                     for information on ranges).  This example copies every
  11233.                     file in the E:\MYDIR directory, which was created or
  11234.                     modified yesterday, and which is also 10,000 bytes or
  11235.                     smaller in size, to the root directory of drive A:
  11236.  
  11237.                          c:\> copy /[d-1] /[s0,10000] e:\mydir\*.* a:\
  11238.  
  11239.                ##   COPY maintains the hidden and system attributes of
  11240.                     files, but not the read-only attribute.  The
  11241.                     destination file will always have the archive
  11242.                     attribute set.
  11243.  
  11244.            4DOS ##  If you are using 4DOS in an OS/2 DOS session, COPY
  11245.                     will copy OS/2 extended attributes from the source to
  11246.                     the destination, if the file system on the destination
  11247.                     drive supports them.
  11248.  
  11249.             4NT ##  If you COPY files with long filenames from an NTFS
  11250.                     volume to a FAT volume, 4DOS/NT will store the
  11251.                     destination files with their short, FAT-compatible
  11252.                     names when running under Windows NT 3.1 (long names
  11253.                     are used under Windows NT 3.5 and above; see page 18
  11254.                     for additional details).  You can view the short names
  11255.                     before executing the COPY with the DIR /X command.
  11256.  
  11257.         Options:    The /A(SCII) and /B(inary) options apply to the
  11258.                     preceding filename and to all subsequent filenames on
  11259.                     the command line until the file name preceding the
  11260.                     next /A or /B, if any.  The other options (/A:, /C,
  11261.                     /H, /M, /N, /P, /Q, /R, /S, /T, /U, /V) apply to all
  11262.                     filenames on the command line, no matter where you put
  11263.                     them.  For example, either of the following commands
  11264.                     could be used to copy a font file to the printer in
  11265.                     binary mode:
  11266.  
  11267.                          c:\> copy /b myfont.dat prn
  11268.  
  11269.         -------------------------------------------------------------------
  11270.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 190
  11271.                                                                        COPY
  11272.         -------------------------------------------------------------------
  11273.  
  11274.  
  11275.                          c:\> copy myfont.dat /b prn
  11276.  
  11277.                     Some options do not make sense in certain contexts, in
  11278.                     which case COPY will ignore them.  For example, you
  11279.                     cannot prompt before replacing an existing file when
  11280.                     the destination is a device such as the printer -
  11281.                     there's no such thing as an "existing file" on the
  11282.                     printer.  If you use conflicting output options, like
  11283.                     /Q and /P, COPY will take a "conservative" approach
  11284.                     and give priority to the option which generates more
  11285.                     prompts or more information.
  11286.  
  11287.                     Options used in less common situations have been
  11288.                     marked with ## below.  Remember that the options are
  11289.                     in alphabetical order, so more basic options are
  11290.                     interspersed with those marked with ##.
  11291.  
  11292.                ##   /A(SCII):  If you use /A with a source filename, the
  11293.                     file will be copied up to, but not including, the
  11294.                     first Ctrl-Z (Control-Z or ASCII 26) character in the
  11295.                     file.  If you use /A with a destination filename, a
  11296.                     Ctrl-Z will be added to the end of the file (some
  11297.                     application programs use the Ctrl-Z to mark the end of
  11298.                     a file).  /A is the default when appending files, or
  11299.                     when the destination is a device like NUL or PRN,
  11300.                     rather than a disk file.
  11301.  
  11302.                ##   /A:(ttribute selecte): Select only those files that
  11303.                     have the specified attribute(s) set.  Preceding the
  11304.                     attribute character with a hyphen [-] will select
  11305.                     files that do not have that attribute set.  The
  11306.                     attributes are:
  11307.  
  11308.                          R    Read-only         D    Subdirectory
  11309.                          H    Hidden            A    Archive
  11310.                          S    System
  11311.  
  11312.                     If no attributes are listed at all (e.g., COPY /A:
  11313.                     ...), COPY will select all files and subdirectories
  11314.                     including hidden and system files.  If attributes are
  11315.                     combined, all the specified attributes must match for
  11316.                     a file to be selected.  For example, /A:RHS will
  11317.                     select only those files with all three attributes set.
  11318.                     See page 18 for more information on file attributes.
  11319.  
  11320.                     You must include the colon with this option to
  11321.                     distinguish it from the /A(SCII) switch, above.
  11322.  
  11323.                ##   /B(inary):  If you use /B with a source filename, the
  11324.                     entire file is copied; Ctrl-Z characters in the file
  11325.  
  11326.         -------------------------------------------------------------------
  11327.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 191
  11328.                                                                        COPY
  11329.         -------------------------------------------------------------------
  11330.  
  11331.  
  11332.                     do not affect the copy operation.  Using /B with a
  11333.                     destination filename prevents addition of a Ctrl-Z to
  11334.                     the end of the destination file.  /B is the default
  11335.                     for normal file copies.
  11336.  
  11337.                     /C(hanged files):  Copy files only if the destination
  11338.                     file exists and is older than the source (see also
  11339.                     /U).  This option is useful for updating the files in
  11340.                     one directory from those in another without copying
  11341.                     any newly created files.
  11342.  
  11343.                ##   /H(idden):  Copy all matching files including those
  11344.                     with the hidden and/or system attribute set (see page
  11345.                       ).                    18
  11346.  
  11347.                     /M(odified):  Copy only those files with the archive
  11348.                     attribute set (see page 18), i.e., those which have
  11349.                     been modified since the last backup.  The archive
  11350.                     attribute will not be cleared after copying; to clear
  11351.                     it use ATTRIB (page 173).
  11352.  
  11353.                     /N(othing):  Do everything except actually perform the
  11354.                     copy.  This option is useful for testing what the
  11355.                     result of a complex COPY command will be.
  11356.  
  11357.                     /P(rompt):  Ask the user to confirm each source file.
  11358.                     Your options at the prompt are explained in detail on
  11359.                     page 50.
  11360.  
  11361.                     /Q(uiet):  Don't display filenames or the total number
  11362.                     of files copied.  This option is most often used in
  11363.                     batch files.  See also /T.
  11364.  
  11365.                     /R(eplace):  Prompt the user before overwriting an
  11366.                     existing file.   Your options at the prompt are
  11367.                     explained in detail on page 50.
  11368.  
  11369.                     /S(ubdirectories):  Copy the subdirectory tree
  11370.                     starting with the files in the source directory plus
  11371.                     each subdirectory below that.  The destination must be
  11372.                     a directory; if it doesn't exist, COPY will attempt to
  11373.                     create it.  COPY will also attempt to create needed
  11374.                     subdirectories on the tree below the destination,
  11375.                     including empty source directories.    If you attempt
  11376.                     to use COPY /S to copy a subdirectory tree into part
  11377.                     of itself, COPY will display an error message and
  11378.                     exit.
  11379.  
  11380.                     /T(otals):  Turns off  the display of filenames, like
  11381.                     /Q, but does display the total number of files copied.
  11382.  
  11383.         -------------------------------------------------------------------
  11384.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 192
  11385.                                                                        COPY
  11386.         -------------------------------------------------------------------
  11387.  
  11388.  
  11389.                     /U(pdate):  Copy each source file only if it is newer
  11390.                     than a matching destination file or if a matching
  11391.                     destination file does not exist (see also /C).  This
  11392.                     option is useful for keeping one directory matched
  11393.                     with another with a minimum of copying.
  11394.  
  11395.                ##   /V(erify):  Verify each disk write.  This is the same
  11396.                     as executing the VERIFY ON command, but is only active
  11397.                     during the COPY.  /V does not read back the file and
  11398.                     compare its contents with what was written; it only
  11399.                     verifies that the data written to disk is physically
  11400.                     readable.
  11401.  
  11402.  
  11403.  
  11404.  
  11405.  
  11406.  
  11407.  
  11408.  
  11409.  
  11410.  
  11411.  
  11412.  
  11413.  
  11414.  
  11415.  
  11416.  
  11417.  
  11418.  
  11419.  
  11420.  
  11421.  
  11422.  
  11423.  
  11424.  
  11425.  
  11426.  
  11427.  
  11428.  
  11429.  
  11430.  
  11431.  
  11432.  
  11433.  
  11434.  
  11435.  
  11436.  
  11437.  
  11438.  
  11439.  
  11440.         -------------------------------------------------------------------
  11441.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 193
  11442.                                                             [4DOS]     CTTY
  11443.         -------------------------------------------------------------------
  11444.  
  11445.  
  11446.         CTTY      [4DOS]                                       (Compatible)
  11447.  
  11448.         Purpose:    Change the default console device.
  11449.  
  11450.         Format:     CTTY device
  11451.  
  11452.                     device:  The new console device.
  11453.  
  11454.         ##  Usage:  Normally, 4DOS uses the keyboard as the standard input
  11455.                     device and the display as the standard output device.
  11456.                     Together, the keyboard and display are known as the
  11457.                     console or CON.  The CTTY command allows you to
  11458.                     substitute another device that can perform standard
  11459.                     character I/O for the console.
  11460.  
  11461.                     For example to change the console to the first serial
  11462.                     port:
  11463.  
  11464.                          c:\> ctty com1
  11465.  
  11466.                     Change the console back to the standard keyboard and
  11467.                     display (this command must be entered from the current
  11468.                     console, e.g., a terminal attached to COM1, or from a
  11469.                     batch file):
  11470.  
  11471.                          c:\> ctty con
  11472.  
  11473.                     CTTY works only for programs and commands that use
  11474.                     standard DOS input and output functions.  This
  11475.                     includes all 4DOS internal commands except DRAWBOX,
  11476.                     DRAWHLINE, DRAWVLINE, LIST, SCREEN, SCRPUT, SELECT,
  11477.                     and VSCRPUT.  In addition, if you use color-coded
  11478.                     directories you should disable them with DIR /D when
  11479.                     using CTTY.  Otherwise directories will not be
  11480.                     displayed correctly.
  11481.  
  11482.  
  11483.  
  11484.  
  11485.  
  11486.  
  11487.  
  11488.  
  11489.  
  11490.  
  11491.  
  11492.  
  11493.  
  11494.  
  11495.  
  11496.  
  11497.         -------------------------------------------------------------------
  11498.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 194
  11499.                                                                        DATE
  11500.         -------------------------------------------------------------------
  11501.  
  11502.  
  11503.         DATE                                                   (Compatible)
  11504.  
  11505.         Purpose:    Display and optionally change the system date.
  11506.  
  11507.         Format:     DATE [mm-dd-yy]
  11508.  
  11509.                     mm:  The month (1 - 12).
  11510.                     dd:  The day (1 - 31).
  11511.                     yy:  The year (80 - 99 = 1980 - 1999, or a 4-digit
  11512.                     year).
  11513.  
  11514.                     See also:  TIME.
  11515.  
  11516.         Usage:      If you simply type DATE without any parameters, you
  11517.                     will see the current system date and time, and be
  11518.                     prompted for a new date.  Press ENTER if you don't
  11519.                     wish to change the date.  If you type a new date, it
  11520.                     will become the current system date, which is included
  11521.                     in the directory entry for each file as it is created
  11522.                     or altered:
  11523.  
  11524.                          c:\> date
  11525.                          Wed  Dec 22, 1993  9:30:06
  11526.                          Enter new date (mm-dd-yy):
  11527.  
  11528.                     You can also enter a new system date by typing the
  11529.                     DATE command plus the new date on the command line:
  11530.  
  11531.                          c:\> date 3-16-94
  11532.  
  11533.                     You can use hyphens, slashes, or periods to separate
  11534.                     the month, day, and year entries.  A full 4-digit year
  11535.                     can be entered if you wish.
  11536.  
  11537.                     DATE adjusts the format it expects depending on your
  11538.                     country settings.  When entering the date, use the
  11539.                     correct format for the country setting currently in
  11540.                     effect on your system.
  11541.  
  11542.  
  11543.  
  11544.  
  11545.  
  11546.  
  11547.  
  11548.  
  11549.  
  11550.  
  11551.  
  11552.  
  11553.  
  11554.         -------------------------------------------------------------------
  11555.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 195
  11556.                                                                 DEL / ERASE
  11557.         -------------------------------------------------------------------
  11558.  
  11559.  
  11560.         DEL / ERASE                                              (Enhanced)
  11561.  
  11562.         Purpose:    Erase one file, a group of files, or entire
  11563.                     subdirectories.
  11564.  
  11565.         Format:     DEL [/A[[:][-]rhsda] /F /N /P /Q /S /T /X /Y /Z]
  11566.                     file...
  11567.  
  11568.                          or
  11569.  
  11570.                     ERASE [/A[[:][-]rhsda] /F /N /P /Q /S /T /X /Y /Z]
  11571.                     file...
  11572.  
  11573.                     file:  The file, subdirectory, or list of files or
  11574.                     subdirectories to erase.
  11575.  
  11576.                     /A(ttribute select)      /S(ubdirectories)
  11577.                     /F(orce delete)          /T(otal)
  11578.                     /N(othing)               /X (remove empty
  11579.                     subdirectories)
  11580.                     /P(rompt)                /Y(es to all prompts)
  11581.                     /Q(uiet)                 /Z(ap hidden and read-only
  11582.                     files)
  11583.  
  11584.         Selection:  Supports extended wildcards, ranges, multiple file
  11585.                     names, and include lists (see pages 59 - 67).
  11586.  
  11587.         Usage:      DEL and ERASE are synonyms, you can use either one.
  11588.  
  11589.                     Use the DEL and ERASE commands with caution; the files
  11590.                     and subdirectories that you erase may be impossible to
  11591.                     recover without specialized utilities and a lot of
  11592.                     work.
  11593.  
  11594.                     To erase a single file, simply enter the file name:
  11595.  
  11596.                          c:\> del letters.txt
  11597.  
  11598.                     You can also erase multiple files in a single command.
  11599.                     For example, to erase all the files in the current
  11600.                     directory with a .BAK or .PRN extension:
  11601.  
  11602.                          c:\> del *.bak *.prn
  11603.  
  11604.                     If you enter a subdirectory name, or a filename
  11605.                     composed only of wildcards (* and/or ?), DEL asks for
  11606.                     confirmation (Y or N) unless you specified the /Y
  11607.                     option.  If you respond with a Y, DEL will delete all
  11608.                     the files in that subdirectory (hidden, system, and
  11609.  
  11610.  
  11611.         -------------------------------------------------------------------
  11612.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 196
  11613.                                                                 DEL / ERASE
  11614.         -------------------------------------------------------------------
  11615.  
  11616.  
  11617.                     read-only files are only deleted if you use the /Z
  11618.                     option).
  11619.  
  11620.                     DEL displays the amount of disk space recovered,
  11621.                     unless the /Q option is used (see below).  It does so
  11622.                     by comparing the amount of free disk space before and
  11623.                     after the DEL command is executed.  This amount may be
  11624.                     incorrect if you are using a deletion tracking system
  11625.                     which stores deleted files in a hidden directory, or
  11626.                     if, under a multitasking system, another program
  11627.                     performs a file operation while the DEL command is
  11628.                     executing.
  11629.  
  11630.                     Remember that DEL removes file descriptions along with
  11631.                     files.  Most deletion tracking systems will not be
  11632.                     able to save or recover a file's description, even if
  11633.                     they can save or recover the data in a file.
  11634.  
  11635.                ##   DEL returns a non-zero exit code if no files are
  11636.                     deleted, or if another error occurs.  You can test
  11637.                     this exit code with the %_? environment variable (see
  11638.                     page 102), and use it with conditional commands (&&
  11639.                     and ||; see page 71).
  11640.  
  11641.         Options: ## /A(ttribute select): Delete only those files that have
  11642.                     the specified attribute(s) set.  Preceding the
  11643.                     attribute character with a hyphen [-] will delete
  11644.                     files that do not have that attribute set.  The
  11645.                     attributes are:
  11646.  
  11647.                          R    Read-only         D    Subdirectory
  11648.                          H    Hidden            A    Archive
  11649.                          S    System
  11650.  
  11651.                     If no attributes are listed at all (e.g., DEL /A ...),
  11652.                     DEL will delete all files and subdirectories including
  11653.                     hidden and system files.  If attributes are combined,
  11654.                     all the specified attributes must match for a file to
  11655.                     be selected for deletion.  For example, /A:RHS will
  11656.                     select only those files with all three attributes set.
  11657.                     See page 18 for more information on file attributes.
  11658.  
  11659.                ##   /F(orce delete):  This option is only for use in the
  11660.                     32-bit version of 4OS2, and in 4DOS when running in an
  11661.                     OS/2 2.1 or later DOS session.  It forces deletion of
  11662.                     the file without saving it to the DELDIR directory (if
  11663.                     DELDIR is not in use, /F has no effect).
  11664.  
  11665.  
  11666.  
  11667.  
  11668.         -------------------------------------------------------------------
  11669.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 197
  11670.                                                                 DEL / ERASE
  11671.         -------------------------------------------------------------------
  11672.  
  11673.  
  11674.                     /N(othing):  Do everything except actually delete the
  11675.                     file(s).  This is useful for testing what the result
  11676.                     of a DEL would be.
  11677.  
  11678.                     /P(rompt):  Prompt the user to confirm each erasure.
  11679.                     Your options at the prompt are explained in detail on
  11680.                     page 50.
  11681.  
  11682.                     /Q(uiet):  Don't display filenames as they are
  11683.                     deleted, or the number of files deleted or bytes
  11684.                     freed.  When running 4DOS under DOS, DEL will run
  11685.                     fastest if you specify the /Q option and the filename
  11686.                     doesn't use the extended 4DOS wildcards.  When running
  11687.                     4OS2, 4DOS/NT, or 4DOS under OS/2, /Q will have little
  11688.                     or no effect on DEL's speed.  See also /T.
  11689.  
  11690.                !    /S(ubdirectories):  Delete the specified files in this
  11691.                     directory and all of its subdirectories.  This is like
  11692.                     a GLOBAL DEL, and can be used to delete all the files
  11693.                     in a subdirectory tree or even a whole disk.  It
  11694.                     should be used with caution!
  11695.  
  11696.                     /T(otal):  Don't display filenames as they are
  11697.                     deleted, but display the total number of files deleted
  11698.                     plus the amount of free disk space recovered.  Unlike
  11699.                     /Q, the /T option will not speed up deletions under
  11700.                     DOS.
  11701.  
  11702.                ##   /X (remove empty subdirectories):  Remove empty
  11703.                     subdirectories after deleting (only useful when used
  11704.                     with /S).
  11705.  
  11706.                ! ## /Y(es):  The reverse of /P - it assumes a Y response
  11707.                     to everything, including deleting an entire
  11708.                     subdirectory tree.  4DOS, 4OS2, and 4DOS/NT normally
  11709.                     prompt before deleting files when the name consists
  11710.                     only of wildcards or a subdirectory name (see above);
  11711.                     /Y overrides this protection, and should be used with
  11712.                     extreme caution!
  11713.  
  11714.                ! ## /Z(ap):  Delete read-only, hidden, and system files as
  11715.                     well as normal files.  Files with the read-only,
  11716.                     hidden, or system attribute set are normally protected
  11717.                     from deletion; /Z overrides this protection, and
  11718.                     should be used with caution.  Because EXCEPT works by
  11719.                     hiding files, /Z will override an EXCEPT command.
  11720.  
  11721.                     For example, to delete the entire subdirectory tree
  11722.                     starting with C:\UTIL, including hidden and read-only
  11723.  
  11724.  
  11725.         -------------------------------------------------------------------
  11726.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 198
  11727.                                                                 DEL / ERASE
  11728.         -------------------------------------------------------------------
  11729.  
  11730.  
  11731.                     files, without prompting (use this command with
  11732.                     CAUTION!):
  11733.  
  11734.                          c:\> del /sxyz c:\util\
  11735.  
  11736.  
  11737.  
  11738.  
  11739.  
  11740.  
  11741.  
  11742.  
  11743.  
  11744.  
  11745.  
  11746.  
  11747.  
  11748.  
  11749.  
  11750.  
  11751.  
  11752.  
  11753.  
  11754.  
  11755.  
  11756.  
  11757.  
  11758.  
  11759.  
  11760.  
  11761.  
  11762.  
  11763.  
  11764.  
  11765.  
  11766.  
  11767.  
  11768.  
  11769.  
  11770.  
  11771.  
  11772.  
  11773.  
  11774.  
  11775.  
  11776.  
  11777.  
  11778.  
  11779.  
  11780.  
  11781.  
  11782.         -------------------------------------------------------------------
  11783.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 199
  11784.                                                                       DELAY
  11785.         -------------------------------------------------------------------
  11786.  
  11787.  
  11788.         DELAY                                                         (New)
  11789.  
  11790.         Purpose:    Pause for a specified length of time.
  11791.  
  11792.         Format:     DELAY [seconds]
  11793.  
  11794.                     seconds:  The number of seconds to delay.
  11795.  
  11796.         Usage:      DELAY is useful in batch file loops while waiting for
  11797.                     something to occur.  To wait for 10 seconds:
  11798.  
  11799.                          delay 10
  11800.  
  11801.                     A simple loop could make a tone with the BEEP command
  11802.                     to get the operator's attention and then DELAY for a
  11803.                     few seconds while waiting for the user to respond.
  11804.  
  11805.                ##   For delays shorter than one second, use the BEEP
  11806.                     command with an inaudible frequency (below 20 Hz).
  11807.  
  11808.                     You can cancel a delay by pressing Ctrl-C or Ctrl-
  11809.                          .                    Break
  11810.  
  11811.  
  11812.  
  11813.  
  11814.  
  11815.  
  11816.  
  11817.  
  11818.  
  11819.  
  11820.  
  11821.  
  11822.  
  11823.  
  11824.  
  11825.  
  11826.  
  11827.  
  11828.  
  11829.  
  11830.  
  11831.  
  11832.  
  11833.  
  11834.  
  11835.  
  11836.  
  11837.  
  11838.  
  11839.         -------------------------------------------------------------------
  11840.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 200
  11841.                                                                    DESCRIBE
  11842.         -------------------------------------------------------------------
  11843.  
  11844.  
  11845.         DESCRIBE                                                      (New)
  11846.  
  11847.         Purpose:    Create, modify, or delete file and subdirectory
  11848.                     descriptions.
  11849.  
  11850.         Format:     DESCRIBE [/A[[:][-]rhsda]] file ["description"] ...
  11851.  
  11852.                     file:  The file or files to operate on.
  11853.                     "description":  The description to attach to the file.
  11854.  
  11855.                     /A(ttribute select)
  11856.  
  11857.         Selection:  Supports extended wildcards, ranges, multiple file
  11858.                     names, and include lists (see pages 59 - 67).
  11859.  
  11860.         Usage:      DESCRIBE adds descriptions to files and
  11861.                     subdirectories.  The descriptions are displayed by DIR
  11862.                     in single-column mode and by SELECT.  Descriptions let
  11863.                     you identify your files in much more meaningful ways
  11864.                     than you can in an eight-character filename.
  11865.  
  11866.                     You enter a description on the command line by typing
  11867.                     the DESCRIBE command, the filename, and the
  11868.                     description in quotation marks, like this:
  11869.  
  11870.                          c:\> describe memo.txt "Memo to Bob about party"
  11871.  
  11872.                     If you don't put a description on the command line,
  11873.                     DESCRIBE will prompt you for it:
  11874.  
  11875.                          c:\> describe memo.txt
  11876.                          Describe "memo.txt" : Memo to Bob about party
  11877.  
  11878.                     If you use wildcards or multiple filenames with the
  11879.                     DESCRIBE command and don't include the description
  11880.                     text, you will be prompted to enter a description for
  11881.                     each file.  If you do include the description on the
  11882.                     command line, all matching files will be given the
  11883.                     same description.
  11884.  
  11885.                     Each description can be up to 40 characters long.  You
  11886.                     can change this limit with the DescriptionMax
  11887.                     directive in 4DOS.INI (see page 138).  DESCRIBE can
  11888.                     edit descriptions longer than DescriptionMax (up to a
  11889.                     limit of 200 characters), but will not allow you to
  11890.                     lengthen the existing text.
  11891.  
  11892.                     The descriptions are stored in each directory in a
  11893.                     hidden file called DESCRIPT.ION.  Use the ATTRIB
  11894.                     command to remove the hidden attribute from this file
  11895.  
  11896.         -------------------------------------------------------------------
  11897.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 201
  11898.                                                                    DESCRIBE
  11899.         -------------------------------------------------------------------
  11900.  
  11901.  
  11902.                     if you need to copy or delete it.  DESCRIPT.ION is
  11903.                     always created as a hidden file, but will not be re-
  11904.                     hidden by 4DOS, 4OS2, or 4DOS/NT if you remove the
  11905.                     hidden attribute. You can change the description file
  11906.                     name with the DescriptionName directive in the .INI
  11907.                     file (page 148), and retrieve it with the %_DNAME
  11908.                     internal variable (page 105).
  11909.  
  11910.                     The description file is modified appropriately
  11911.                     whenever you perform an internal command which affects
  11912.                     it (such as COPY, MOVE, DEL, or RENAME), but not if
  11913.                     you use an external program (such as XCOPY or a visual
  11914.                     shell).
  11915.  
  11916.             4OS2, ! On HPFS and NTFS drives, you will not see file
  11917.             4NT     descriptions in a normal DIR display, because DIR must
  11918.                     leave space for the long filenames used on these
  11919.                     drives.  To view the descriptions, use DIR /Z to
  11920.                     display the directory in FAT format.  See the DIR
  11921.                     command for more details.
  11922.  
  11923.         Options: ## /A(ttribute select): Select only those files that have
  11924.                     the specified attribute(s) set.  Preceding the
  11925.                     attribute character with a hyphen [-] will select
  11926.                     files that do not have that attribute set.  The
  11927.                     attributes are:
  11928.  
  11929.                          R    Read-only         D    Subdirectory
  11930.                          H    Hidden            A    Archive
  11931.                          S    System
  11932.  
  11933.                     If no attributes are listed at all (e.g., DESCRIBE /A
  11934.                     ...), DESCRIBE will select all files and
  11935.                     subdirectories including hidden and system files.  If
  11936.                     attributes are combined, all the specified attributes
  11937.                     must match for a file to be selected.  For example,
  11938.                     /A:RHS will select only those files with all three
  11939.                     attributes set.  See page 18 for more information on
  11940.                     file attributes.
  11941.  
  11942.  
  11943.  
  11944.  
  11945.  
  11946.  
  11947.  
  11948.  
  11949.  
  11950.  
  11951.  
  11952.  
  11953.         -------------------------------------------------------------------
  11954.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 202
  11955.                                                  [4OS2, 4DOS/NT]     DETACH
  11956.         -------------------------------------------------------------------
  11957.  
  11958.  
  11959.         DETACH      [4OS2, 4DOS/NT]                            (Compatible)
  11960.  
  11961.         Purpose:    Start an OS/2 or Windows NT program in detached mode.
  11962.  
  11963.         Format:     DETACH command
  11964.  
  11965.                     command:  The name of a command to execute, including
  11966.                     an optional drive and path specification.  The name
  11967.                     must be enclosed in quotation marks if it contains any
  11968.                     spaces.
  11969.  
  11970.                     See also:  START.
  11971.  
  11972.         Usage:      When you start a program with DETACH, that program
  11973.                     cannot use the keyboard, mouse, or video display.  It
  11974.                     is "detached" from the normal means of user input and
  11975.                     output.  However, you can redirect the program's
  11976.                     standard I/O to other devices if necessary, using
  11977.                     redirection symbols (see page 52).
  11978.  
  11979.                     The command can be an internal command, external
  11980.                     command, alias, or batch file.  4OS2 or 4DOS/NT will
  11981.                     detach a copy of itself to execute the command.
  11982.  
  11983.                     For example, the following command will detach a copy
  11984.                     of the command processor to run the batch file
  11985.                     XYZ.BTM:
  11986.  
  11987.                          [c:\] detach xyz.btm
  11988.  
  11989.                     Once the program has started, 4OS2 or 4DOS/NT returns
  11990.                     to the prompt immediately.  It does not wait for a
  11991.                     detached program to finish.
  11992.  
  11993.  
  11994.  
  11995.  
  11996.  
  11997.  
  11998.  
  11999.  
  12000.  
  12001.  
  12002.  
  12003.  
  12004.  
  12005.  
  12006.  
  12007.  
  12008.  
  12009.  
  12010.         -------------------------------------------------------------------
  12011.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 203
  12012.                                                                         DIR
  12013.         -------------------------------------------------------------------
  12014.  
  12015.  
  12016.         DIR                                                      (Enhanced)
  12017.  
  12018.         Purpose:    Display information about files and subdirectories.
  12019.  
  12020.         Format:     DIR [/1 /2 /4 /A[[:][-]rhsda] /B /C[HP] /D /E /F /H
  12021.                          /I"text" /J /K /L /M /N /O[[:][-]acdeginrsu] /P
  12022.                          /R /S /T[:acw] /U /V /W /X /Z] [file...]
  12023.  
  12024.                     file:  The file, directory, or list of files or
  12025.                     directories to display.
  12026.  
  12027.                     /1  (one column)         /L(ower case)
  12028.                     /2  (two columns)        /M  (suppress footer)
  12029.                     /4  (four columns)       /N(ormal) or (New format)
  12030.                     /A(ttribute select)      /O(rder)
  12031.                     /B(are)                  /P(ause)
  12032.                     /C[HP] (Compression)     /R  (disable wRap)
  12033.                     /D(isable color coding)  /S(ubdirectories)
  12034.                     /E  (upper case)         /T  (aTtribute) or (Time)
  12035.                     /F(ull path)             /U  (sUmmary information)
  12036.                     /H(ide dots)             /V(ertical sort)
  12037.                     /I  (match descriptions) /W(ide)
  12038.                     /J(ustify names)         /X  (display short names)
  12039.                     /K  (suppress header)    /Z  (use FAT format)
  12040.  
  12041.  
  12042.                     See also:  ATTRIB, DESCRIBE, SELECT, and SETDOS.
  12043.  
  12044.         Selection:  Supports extended wildcards, ranges, multiple file
  12045.                     names, and include lists (see pages 59 - 67).
  12046.  
  12047.         Usage:      DIR can be used to display information about files
  12048.                     from one or more of your disk directories, in a wide
  12049.                     range of formats.  Depending on the options chosen,
  12050.                     you can display the file name, attributes, and size;
  12051.                     the time and date of the last change to the file; the
  12052.                     file description; and the file's compression ratio.
  12053.                     You can also display information in 1, 2, 4, or 5
  12054.                     columns, sort the files several different ways, use
  12055.                     color to distinguish file types, and pause after each
  12056.                     full screen.
  12057.  
  12058.                     The various DIR displays are controlled through
  12059.                     options or switches.  The best way to learn how to use
  12060.                     the many options available with the DIR command is to
  12061.                     experiment.  You will soon know which options you want
  12062.                     to use regularly.  You can select those options
  12063.                     permanently by using the ALIAS command.
  12064.  
  12065.  
  12066.  
  12067.         -------------------------------------------------------------------
  12068.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 204
  12069.                                                                         DIR
  12070.         -------------------------------------------------------------------
  12071.  
  12072.  
  12073.                     You may want to mix several options.  For example, to
  12074.                     display all the files in the current directory, in 2
  12075.                     columns, sorted vertically (down one column then down
  12076.                     the next), and with a pause at the end of each page:
  12077.  
  12078.                          c:\> dir /2/p/v
  12079.  
  12080.                     To set up this format as the default, using an alias:
  12081.  
  12082.                          c:\> alias dir=*dir /2/p/v
  12083.  
  12084.                     This example displays all the files on all directories
  12085.                     of drive C, including hidden and system files, pausing
  12086.                     after each page:
  12087.  
  12088.                          c:\> dir /s/a/p c:\
  12089.  
  12090.                     DIR allows wildcard characters (* and ?) in the
  12091.                     filename.  If you don't specify a filename, DIR
  12092.                     defaults to *.* (display all non-hidden files and
  12093.                     subdirectories in the current directory).  To display
  12094.                     all of the .WKS files in the current directory:
  12095.  
  12096.                          c:\> dir *.wks
  12097.  
  12098.                     With the /I option, DIR can select files to display
  12099.                     based on their descriptions.  DIR will display a file
  12100.                     if its description matches the text after the /I
  12101.                     switch.  The search is not case sensitive.  You can
  12102.                     use wildcards and extended wildcards as part of the
  12103.                     text.  For example, to display any file described as a
  12104.                     "Test File" you can use this command:
  12105.  
  12106.                          c:\> dir /i"test file"
  12107.  
  12108.                     If you want to display files that include the words
  12109.                     "test file" anywhere in their descriptions, use
  12110.                     extended wild cards like this:
  12111.  
  12112.                          c:\> dir /i"*test file*"
  12113.  
  12114.                     If you link two or more filenames together with
  12115.                     spaces, DIR will display all of the files that match
  12116.                     the first name and then all of the files that match
  12117.                     the second name.  You may use a different drive and
  12118.                     path for each filename.  This example lists all of the
  12119.                     .WKS and then all of the .WK1 files in the current
  12120.                     directory:
  12121.  
  12122.                          c:\> dir *.wks *.wk1
  12123.  
  12124.         -------------------------------------------------------------------
  12125.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 205
  12126.                                                                         DIR
  12127.         -------------------------------------------------------------------
  12128.  
  12129.  
  12130.                     If you use an include list (see page 67) to link
  12131.                     multiple filenames, DIR will display the matching
  12132.                     filenames in a single listing.  Only the first
  12133.                     filename in an include list can have a path; the other
  12134.                     files must be in the same path.  This example displays
  12135.                     the same files as the previous example, but the .WKS
  12136.                     and .WK1 files are intermixed:
  12137.  
  12138.                          c:\> dir *.wks;*.wk1
  12139.  
  12140.                     The default case for filename displays varies
  12141.                     depending on which command processor you are using, as
  12142.                     follows ("as stored" means filenames will be displayed
  12143.                     exactly as they are stored on the disk, whether in
  12144.                     upper, lower, or mixed case):
  12145.  
  12146.                          4DOS         Lower case on all drives.
  12147.  
  12148.                          4OS2         Lower case on FAT drives, "as stored"
  12149.                                       on HPFS drives.
  12150.  
  12151.                          4DOS/NT      Windows NT 3.1:  Lower case on FAT
  12152.                                       drives, "as stored" on HPFS and NTFS
  12153.                                       drives.  Windows NT 3.5 and above:
  12154.                                       "As stored" on all drives (see page
  12155.                                       18 for more information)
  12156.  
  12157.                     You can override these defaults and force filenames to
  12158.                     display in upper case with /E, or in lower case with
  12159.                     /L.
  12160.  
  12161.                     You can display the file and subdirectory names in
  12162.                     color by setting the COLORDIR environment variable or
  12163.                     using the ColorDir directive in your .INI file.  See
  12164.                     page 30 for details.
  12165.  
  12166.                ##   If you are using color-coded directories and attempt
  12167.                     to redirect the output of DIR to a character device,
  12168.                     such as a serial port or the printer, non-color-coded
  12169.                     file names will be displayed on the device but color-
  12170.                     coded names may still be displayed on the screen.
  12171.                     This will not occur if the output of DIR is redirected
  12172.                     to a disk file.  To prevent this problem, use the /D
  12173.                     switch to disable color coding when redirecting the
  12174.                     output of DIR to a character device.
  12175.  
  12176.                     When displaying file descriptions, DIR will wrap long
  12177.                     lines to fit on the screen.  DIR displays a maximum of
  12178.                     40 characters of text in each line of a description,
  12179.                     unless your screen width allows a wider display.  If
  12180.  
  12181.         -------------------------------------------------------------------
  12182.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 206
  12183.                                                                         DIR
  12184.         -------------------------------------------------------------------
  12185.  
  12186.  
  12187.                     you disable description wrapping with the /R switch,
  12188.                     the description is truncated at the right edge of the
  12189.                     screen, and a right arrow is added at the end of the
  12190.                     line to alert you to the existence of additional
  12191.                     description text.
  12192.  
  12193.                     If you attempt to redirect the output of DIR to a
  12194.                     character device, such as a serial port or the
  12195.                     printer, long descriptions will be wrapped at the
  12196.                     screen width in the redirected output.  If this is not
  12197.                     what you want, use /R to disable wrapping.
  12198.  
  12199.             4NT  ## DIR's default output format is different under Windows
  12200.                     NT 3.5 and above, where long filenames can be used on
  12201.                     on FAT drives (see page 18 for additional
  12202.                     information).  In this case DIR defaults to HPFS /
  12203.                     NTFS-style output, normally selected with /N; you can
  12204.                     switch back to standard FAT-style output with /Z.  DIR
  12205.                     also retains the case in which filenames are stored in
  12206.                     Windows NT 3.5 and above, unless you use /E or /L (see
  12207.                     page 18 for an explanation).                    
  12208.  
  12209.                     You can override the new default output format with an
  12210.                     alias if you wish.  For example, to use FAT-style
  12211.                     output on all drives, define an alias like this:
  12212.  
  12213.                          alias dir=*dir /z
  12214.  
  12215.                     To use FAT-style output on FAT drives only you may
  12216.                     want to try the following alias or a variation on it.
  12217.                     The alias extracts the drive letter from the first
  12218.                     argument to DIR (or uses the current drive if there is
  12219.                     no argument), then changes the display format based on
  12220.                     whether that argument specifies a FAT or non-FAT
  12221.                     drive:
  12222.  
  12223.                          alias dir=`set _drv=%_disk: & if %# != 0 set
  12224.                          _drv=%@fstype[%@substr[%@full[%1],0,2]] & iff
  12225.                          "%_drv" == "FAT" then & *dir /z %$ & else & *dir
  12226.                          %$ & endiff & unset /q _drv`
  12227.  
  12228.             4DOS ## If you are using a disk compression program, you can
  12229.                     use the /C switch to view the amount of compression
  12230.                     achieved for each file.  When you do, the compression
  12231.                     ratio is displayed instead of the file's description.
  12232.                     You can also sort the display by compression ratios
  12233.                     with the /O:c switch.  Details for both switches are
  12234.                     in the Options section, below.  See APPNOTES.DOC for a
  12235.                     list of compression systems supported by the 4DOS DIR
  12236.                     command.
  12237.  
  12238.         -------------------------------------------------------------------
  12239.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 207
  12240.                                                                         DIR
  12241.         -------------------------------------------------------------------
  12242.  
  12243.  
  12244.                ##   When sorting file names and extensions, 4DOS, 4OS2,
  12245.                     and 4DOS/NT normally assume that sequences of digits
  12246.                     should be sorted numerically (for example, the file
  12247.                     DRAW2 would come before DRAW03 because 2 is
  12248.                     numerically smaller than 03), rather than strictly
  12249.                     alphabetically (where DRAW2 would come second because
  12250.                     "2" is after "0" in alphanumeric order).  You can
  12251.                     defeat this behavior and force a strict alphabetic
  12252.                     sort with the /O:a option.
  12253.  
  12254.                ##   If you have selected a specific country code for your
  12255.                     system, DIR will display the date in the format for
  12256.                     that country.  The default date format is U.S. (mm-dd-
  12257.                     yy).  The separator character in the file time will
  12258.                     also be affected by the country code.
  12259.  
  12260.             4DOS ## DIR can handle directories of any size, limited only
  12261.                     by available memory.  Under 4DOS, each filename
  12262.                     requires 32 bytes of free base memory plus the size of
  12263.                     the description (if any).  For example, a system with
  12264.                     just 128K of free memory can display up to 4,000 files
  12265.                     per directory.  Memory requirements for DIR are
  12266.                     generally not a concern under 4OS2 and 4DOS/NT,
  12267.                     because of the virtual memory available under these
  12268.                     operating systems.
  12269.  
  12270.                ##   Options on the command line apply only to the
  12271.                     filenames which follow the option, and options at the
  12272.                     end of the line apply to the preceding filename only.
  12273.                     This allows you to specify different options for
  12274.                     different groups of files, yet retains compatibility
  12275.                     with the traditional DIR command when a single
  12276.                     filename is specified.
  12277.  
  12278.         Options:    /1:  Single column display - display the filename,
  12279.                     size, date, time, and description.  This is the
  12280.                     default.  If /T is used the attributes are displayed
  12281.                     instead of the description; if /C or /O:c is used the
  12282.                     compression ratio is displayed instead of the
  12283.                     description.
  12284.  
  12285.                     /2:  Two column display - display the filename, size,
  12286.                     date, and time.  If you use /2 (or /4) on an HPFS or
  12287.                     NTFS drive under 4OS2 or 4DOS/NT, DIR will only
  12288.                     display the file names.  Also, the number of columns
  12289.                     may be reduced to one for names too long to fit on
  12290.                     half the screen.  Due to these restrictions, /2 is
  12291.                     normally most useful on HPFS and NTFS drives when used
  12292.                     with /Z to force the display to FAT format.
  12293.  
  12294.  
  12295.         -------------------------------------------------------------------
  12296.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 208
  12297.                                                                         DIR
  12298.         -------------------------------------------------------------------
  12299.  
  12300.  
  12301.                     /4:  Four column display - display the filename and
  12302.                     size, in K (kilobytes) or M (megabytes).  The note
  12303.                     under /2 above regarding HPFS and NTFS drives applies
  12304.                     to /4 as well.
  12305.  
  12306.                ##   /A(ttribute select): Display only those files that
  12307.                     have the specified attribute(s) set.  Preceding the
  12308.                     attribute character with a hyphen [-] will display
  12309.                     files that do not have that attribute set.  The
  12310.                     attributes are:
  12311.  
  12312.                          R    Read-only         D    Subdirectory
  12313.                          H    Hidden            A    Archive
  12314.                          S    System
  12315.  
  12316.                     If no attributes are listed at all (e.g., DIR /A ...),
  12317.                     DIR will display all files and subdirectories
  12318.                     including hidden and system files.  If attributes are
  12319.                     combined, all the specified attributes must match for
  12320.                     a file to be included in the listing.  For example,
  12321.                     /A:RHS will display only those files with all three
  12322.                     attributes set.  See page 18 for more information on
  12323.                     file attributes.
  12324.  
  12325.                ##   /B(are):  Suppress the header and summary lines, and
  12326.                     display file or subdirectory names only, in a single
  12327.                     column.  This option is most useful when you want to
  12328.                     redirect a list of names to a file or another program.
  12329.                     If you use /B with /S, DIR will show the full path of
  12330.                     each file instead of simply its name and extension.
  12331.  
  12332.             4DOS    /C(ompression):  Display per-file and total
  12333.                     compression ratio on compressed drives.  The
  12334.                     compression ratio is displayed instead of the file
  12335.                     description or attributes.  The ratio is left blank
  12336.                     for directories and files with a length of 0 bytes,
  12337.                     and for files on non-compressed drives.  /C only works
  12338.                     in single-column mode; it is ignored if /2, /4, or /W
  12339.                     is used.  See APPNOTES.DOC for a list of supported
  12340.                     compression systems.
  12341.  
  12342.                     The numerator of the displayed compression ratio is
  12343.                     the amount of space which would be allocated to the
  12344.                     file if the compression utility were not in use, based
  12345.                     on the compressed drive's cluster size (usually 8K
  12346.                     bytes).  The denominator is the space actually
  12347.                     allocated for the compressed file.  For example, if a
  12348.                     file is allocated 6,144 bytes when compressed, and
  12349.                     would require 8,192 bytes if uncompressed, the
  12350.  
  12351.  
  12352.         -------------------------------------------------------------------
  12353.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 209
  12354.                                                                         DIR
  12355.         -------------------------------------------------------------------
  12356.  
  12357.  
  12358.                     displayed compression ratio would be 8,192 / 6,144, or
  12359.                     1.3 to 1.
  12360.  
  12361.                     Using /CH displays compression ratios like /C, but
  12362.                     bases the calculation on the host drive's cluster
  12363.                     size.  This gives a more accurate picture of the space
  12364.                     saved through compression than is given by /C.  This
  12365.                     option will occasionally display compression ratios
  12366.                     slightly less than 1.0 to 1.0 for files which have
  12367.                     actually expanded when stored on the compressed drive.
  12368.  
  12369.                     If /CP is used instead of /C, the compression is
  12370.                     displayed as a percentage (e.g., 33%) instead of a
  12371.                     ratio (e.g., 3 to 1).  If /CHP is used instead of /CH,
  12372.                     the host compression is displayed as a percentage.
  12373.                     The /CHP option must be entered as shown; you can not
  12374.                     use /CPH.
  12375.  
  12376.                ##   /D(isable color coding):  Temporarily disable
  12377.                     directory color coding.  May be required when color-
  12378.                     coded directories are used and DIR output is
  12379.                     redirected to a character device like the printer
  12380.                     (e.g., PRN or LPT1) or serial port (e.g., COM1 or
  12381.                     COM2).  /D is not required when DIR output is
  12382.                     redirected to a file.
  12383.  
  12384.                     /E:  Display filenames in the traditional upper case;
  12385.                     also see SETDOS /U (page 326) and the UpperCase
  12386.                     directive in 4DOS.INI (page 141).
  12387.  
  12388.                ##   /F(ull path):  Display each filename with its drive
  12389.                     letter and path in a single column, without other
  12390.                     information.
  12391.  
  12392.                     /H(ide dots):  Suppress the display of the "." and
  12393.                     ".." directories.
  12394.  
  12395.                     /I:  Display filenames by matching text in their
  12396.                     descriptions.  The text can include wild cards and
  12397.                     extended wildcards.  The search text must be enclosed
  12398.                     in quotation marks.  /I may be used to select files
  12399.                     even if descriptions are not displayed (for example,
  12400.                     if /2 is used).  However, /I will be ignored if /C or
  12401.                     /O:c is used.
  12402.  
  12403.                     /J(ustify names):  Justify (align) filename extensions
  12404.                     and display them in the traditional format.
  12405.  
  12406.                ##   /K:  Suppress the header (disk and directory name)
  12407.                     display.
  12408.  
  12409.         -------------------------------------------------------------------
  12410.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 210
  12411.                                                                         DIR
  12412.         -------------------------------------------------------------------
  12413.  
  12414.  
  12415.                     /L(ower case):  Display file and directory names in
  12416.                     lower case; also see SETDOS /U (page 326) and the
  12417.                     UpperCase directive in 4DOS.INI (page 141).
  12418.  
  12419.                ##   /M:  Suppress the footer (file and byte count totals)
  12420.                     display.
  12421.  
  12422.             4DOS    /N:  Reset the DIR options to the default values.
  12423.                     This is useful when you want to display some files in
  12424.                     one format, and then change back to the defaults for
  12425.                     another set of files.
  12426.  
  12427.             4OS2,   /N:  Use the HPFS or NTFS display format, even if the
  12428.                     files are
  12429.             4NT     stored on a FAT file system volume.  (This is the
  12430.                     default for all drives under Windows NT 3.5 and
  12431.                     above).  See also /Z.
  12432.  
  12433.                     /O(rder):  Set the sorting order.  You may use any
  12434.                     combination of the following sorting options; if
  12435.                     multiple options are used, the listing will be sorted
  12436.                     with the first sort option as the primary key, the
  12437.                     next as the secondary key, and so on:
  12438.  
  12439.                          -    Reverse the sort order for the next option
  12440.                          a    Sort names and extensions in standard ASCII
  12441.                               order, rather than sorting numerically when
  12442.                               digits are included in the name or
  12443.                               extension.
  12444.                          c    Sort by compression ratio (the least
  12445.                               compressed file in the list will be
  12446.                               displayed first).  For single-column
  12447.                               directory displays, the compression ratios
  12448.                               will be used as the basis of the sort and
  12449.                               will also be displayed.  For wider displays
  12450.                               (/2, /4, and /W), the compression ratios
  12451.                               will be used to determine the order but will
  12452.                               not be displayed.  If /O:c is used with /CH
  12453.                               or /CHP, the sort will be based on the host-
  12454.                               drive compression ratios.
  12455.                          d    Sort by date and time (oldest first); for
  12456.                               HPFS and NTFS drives also see /T.
  12457.                          e    Sort by extension.
  12458.                          g    Group subdirectories first, then files.
  12459.                          i    Sort by the file description (ignored if /C
  12460.                               or /O:c is also used).
  12461.                          n    Sort by filename (this is the default).
  12462.                          r    Reverse the sort order for all options.
  12463.                          s    Sort by size.
  12464.                          u    Unsorted.
  12465.  
  12466.         -------------------------------------------------------------------
  12467.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 211
  12468.                                                                         DIR
  12469.         -------------------------------------------------------------------
  12470.  
  12471.  
  12472.                     /P(ause):  Wait for a key to be pressed after each
  12473.                     screen page before continuing the display.  Your
  12474.                     options at the prompt are explained in detail on page
  12475.                       .                    50
  12476.  
  12477.                     /R  (disable wRap):  Forces long descriptions to be
  12478.                     displayed on a single line, rather than wrapped onto
  12479.                     two or more lines.  Use /R when output is redirected
  12480.                     to a character device, such as a serial port or the
  12481.                     printer; or when you want descriptions truncated,
  12482.                     rather than wrapped, in the on-screen display.
  12483.  
  12484.                     /S(ubdirectories):  Display file information from the
  12485.                     current directory and all of its subdirectories.  DIR
  12486.                     will only display headers and summaries for those
  12487.                     directories which contain files that match the
  12488.                     filename(s) and attributes (if /A is used) that you
  12489.                     specify on the command line.
  12490.  
  12491.                ##   /T (aTtribute display):  Display the filenames and
  12492.                     attributes.  /T is ignored if /C or /O:c is also used.
  12493.                     The attributes are displayed in the format RHSA,
  12494.                     where:
  12495.  
  12496.                          R    Read-only         S    System
  12497.                          H    Hidden            A    Archive
  12498.  
  12499.             4OS2,   If you wish to add another option after /T, you must
  12500.                     start the next
  12501.             4NT     option with a forward slash.  If you don't, the
  12502.                     command processor will interpret the /T as the /T:acw
  12503.                     time display switch (see below) and the following
  12504.                     character as a valid or invalid time selector.  For
  12505.                     example:
  12506.  
  12507.                          [c:\] dir /tz     incorrect, will display error
  12508.                          [c:\] dir /t/z    correct
  12509.  
  12510.             4OS2,   /T:acw (Time display):  Specify which of the date and
  12511.                     time fields on
  12512.             4NT     an NTFS or HPFS drive should be displayed and used for
  12513.                     sorting:
  12514.  
  12515.                          a    last access time
  12516.                          c    creation time
  12517.                          w    last write time (default)
  12518.  
  12519.                     /U (sUmmary information):  Only display the number of
  12520.                     files, the total file size, and the total amount of
  12521.                     disk space used.
  12522.  
  12523.         -------------------------------------------------------------------
  12524.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 212
  12525.                                                                         DIR
  12526.         -------------------------------------------------------------------
  12527.  
  12528.  
  12529.                     /V(ertical sort):  Display the filenames sorted
  12530.                     vertically rather than horizontally (use with the /2,
  12531.                     /4 or /W options).
  12532.  
  12533.                     /W(ide):  Display filenames only, horizontally across
  12534.                     the screen (5 columns on an 80-character wide
  12535.                     display).
  12536.  
  12537.             4NT     /X:  Display both the short (8-character name plus 3-
  12538.                     character extension) and the long name of files on an
  12539.                     NTFS drive.
  12540.  
  12541.             4OS2,   /Z:  Display an HPFS or NTFS directory, or any
  12542.             4NT     directory under Windows NT 3.5 and above, in FAT
  12543.                     format.  Long names will be truncated to 12
  12544.                     characters.  If the name is longer than 12 characters,
  12545.                     it will be followed by a right arrow to show that one
  12546.                     or more characters have been truncated.
  12547.  
  12548.  
  12549.  
  12550.  
  12551.  
  12552.  
  12553.  
  12554.  
  12555.  
  12556.  
  12557.  
  12558.  
  12559.  
  12560.  
  12561.  
  12562.  
  12563.  
  12564.  
  12565.  
  12566.  
  12567.  
  12568.  
  12569.  
  12570.  
  12571.  
  12572.  
  12573.  
  12574.  
  12575.  
  12576.  
  12577.  
  12578.  
  12579.         -------------------------------------------------------------------
  12580.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 213
  12581.                                                                        DIRS
  12582.         -------------------------------------------------------------------
  12583.  
  12584.  
  12585.         DIRS                                                          (New)
  12586.  
  12587.         Purpose:    Display the current directory stack.
  12588.  
  12589.         Format:     DIRS
  12590.  
  12591.                     See also:  PUSHD and POPD.
  12592.  
  12593.         Usage:      The PUSHD command adds the current default drive and
  12594.                     directory to the directory stack, a list that 4DOS,
  12595.                     4OS2, and 4DOS/NT maintain in memory.  The POPD
  12596.                     command removes the top entry of the directory stack
  12597.                     and makes that drive and directory the new default.
  12598.                     The DIRS command displays the contents of the
  12599.                     directory stack, with the most recent entries on top
  12600.                     (i.e., the next POPD will retrieve the first entry
  12601.                     that DIRS displays).
  12602.  
  12603.                     For example, to change directories and then display
  12604.                     the directory stack:
  12605.  
  12606.                          c:\> pushd c:\database
  12607.                          c:\database> pushd d:\wordp\memos
  12608.                          d:\wordp\memos> dirs
  12609.                          c:\database
  12610.                          c:\
  12611.  
  12612.                     The directory stack holds 255 characters, enough for
  12613.                     10 to 20 typical drive and directory entries.
  12614.  
  12615.  
  12616.  
  12617.  
  12618.  
  12619.  
  12620.  
  12621.  
  12622.  
  12623.  
  12624.  
  12625.  
  12626.  
  12627.  
  12628.  
  12629.  
  12630.  
  12631.  
  12632.  
  12633.  
  12634.  
  12635.  
  12636.         -------------------------------------------------------------------
  12637.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 214
  12638.                                                                          DO
  12639.         -------------------------------------------------------------------
  12640.  
  12641.  
  12642.         DO                                                            (New)
  12643.  
  12644.         Purpose:    Create loops in batch files.
  12645.  
  12646.         Format:     DO [n | FOREVER]
  12647.  
  12648.                          or
  12649.  
  12650.                     DO varname = start TO end [BY n]
  12651.  
  12652.                          or
  12653.  
  12654.                     DO [WHILE | UNTIL] condition
  12655.  
  12656.                     ...
  12657.                     [ITERATE]
  12658.                     [LEAVE]
  12659.                     ...
  12660.                     ENDDO
  12661.  
  12662.                     n, start, end:  An integer between 0 and 2,147,483,647
  12663.                     inclusive, or an internal variable or variable
  12664.                     function that evaluates to such a value.
  12665.                     varname:  The environment variable that will hold the
  12666.                     loop counter.
  12667.                     condition:  A test to determine if the loop should be
  12668.                     executed.
  12669.  
  12670.         Usage:      DO can only be used in batch files.
  12671.  
  12672.                     DO can be used to create 3 different kinds of loops.
  12673.                     The first, introduced by DO n, is a counted loop.  The
  12674.                     batch file lines between DO and ENDDO are repeated n
  12675.                     times.  You can also specify "forever" for n if you
  12676.                     wish to create an endless loop.  For example:
  12677.  
  12678.                          do 5
  12679.                            beep
  12680.                          enddo
  12681.  
  12682.                     The second type of loop is similar to a "for loop" in
  12683.                     programming languages like BASIC.  DO creates an
  12684.                     environment variable, varname, and sets it equal to
  12685.                     the value start (if varname already exists in the
  12686.                     environment, it will be overwritten).  DO then begins
  12687.                     the loop process by comparing the value of varname
  12688.                     with the value of end.  If varname is less than or
  12689.                     equal to end, DO executes the batch file lines up to
  12690.                     the ENDDO.  Next, DO adds 1 to the value of varname,
  12691.                     or adds the value n if BY n is specified, and repeats
  12692.  
  12693.         -------------------------------------------------------------------
  12694.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 215
  12695.                                                                          DO
  12696.         -------------------------------------------------------------------
  12697.  
  12698.  
  12699.                     the compare and execute process until varname is
  12700.                     greater than end.  This example displays the even
  12701.                     numbers from 2 through 20:
  12702.  
  12703.                          do i = 2 to 20 by 2
  12704.                            echo %i
  12705.                          enddo
  12706.  
  12707.                     DO can also count down, rather than up.  If n is
  12708.                     negative, varname will decrease by n with each loop,
  12709.                     and the loop will stop when varname is less than end.
  12710.                     For example, to display the even numbers from 2
  12711.                     through 20 in reverse order, replace the first line of
  12712.                     the example above with:
  12713.  
  12714.                          do i = 20 to 2 by -2
  12715.  
  12716.                     The third type of loop is called a "while loop" or
  12717.                     "until loop."  DO evaluates the condition, which can
  12718.                     be any of the tests supported by the IF command (see
  12719.                     page 251), and executes the lines between DO and ENDDO                    
  12720.                     as long as the condition is true.  The loop ends when
  12721.                     the condition becomes false.
  12722.  
  12723.                     WHILE tests the condition at the start of the loop;
  12724.                     UNTIL tests it at the end.  If you use WHILE, the loop
  12725.                     may never be executed (if the condition is false at
  12726.                     the start of the loop); if you use UNTIL, the loop
  12727.                     will always be executed at least once.
  12728.  
  12729.                     Two special commands, ITERATE and LEAVE, can only be
  12730.                     used inside a DO / ENDDO loop.  ITERATE ignores the
  12731.                     remaining lines inside the loop and returns to the
  12732.                     beginning of loop for another iteration (unless DO
  12733.                     determines that the loop is finished).  LEAVE exits
  12734.                     from the current DO loop and continues with the line
  12735.                     following ENDDO.  Both ITERATE and LEAVE are most
  12736.                     often used in an IF or IFF command (see pages 251 and
  12737.                     257):
  12738.  
  12739.                          do while "%var" != "%val1"
  12740.                            ...
  12741.                            if "%var" == "%val2" leave
  12742.                          enddo
  12743.  
  12744.                     You can nest DO loops up to 15 levels deep.
  12745.  
  12746.                ! ## You can exit from all DO / ENDDO loops by using GOTO
  12747.                     to a line past the last ENDDO.  However, be sure to
  12748.                     read the cautionary notes about GOTO and DO under the
  12749.  
  12750.         -------------------------------------------------------------------
  12751.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 216
  12752.                                                                          DO
  12753.         -------------------------------------------------------------------
  12754.  
  12755.  
  12756.                     GOTO command (page 246) before using a GOTO inside any
  12757.                     DO loop.
  12758.  
  12759.  
  12760.  
  12761.  
  12762.  
  12763.  
  12764.  
  12765.  
  12766.  
  12767.  
  12768.  
  12769.  
  12770.  
  12771.  
  12772.  
  12773.  
  12774.  
  12775.  
  12776.  
  12777.  
  12778.  
  12779.  
  12780.  
  12781.  
  12782.  
  12783.  
  12784.  
  12785.  
  12786.  
  12787.  
  12788.  
  12789.  
  12790.  
  12791.  
  12792.  
  12793.  
  12794.  
  12795.  
  12796.  
  12797.  
  12798.  
  12799.  
  12800.  
  12801.  
  12802.  
  12803.  
  12804.  
  12805.  
  12806.  
  12807.         -------------------------------------------------------------------
  12808.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 217
  12809.                                                            [4OS2]     DPATH
  12810.         -------------------------------------------------------------------
  12811.  
  12812.  
  12813.         DPATH    [4OS2]                                        (Compatible)
  12814.  
  12815.         Purpose:    Specify the subdirectories which applications will
  12816.                     search to find files that are not in the current
  12817.                     directory.
  12818.  
  12819.         Format:     DPATH [directory[;directory...]]
  12820.  
  12821.                     directory:  The full name of a directory to include in
  12822.                     the DPATH (data path) setting.
  12823.  
  12824.                     See also:  PATH, SET, and ESET.
  12825.  
  12826.         Usage:      When most OS/2 and Windows NT applications try to open
  12827.                     a data file, they look for the file in the current
  12828.                     directory first.  If they fail to find the file there,
  12829.                     they search each of the directories in the DPATH
  12830.                     setting in the order that they are included.  Internal
  12831.                     commands like TYPE do not search the DPATH directories
  12832.                     for files.
  12833.  
  12834.                     For example, the following DPATH command directs
  12835.                     applications to look for files in this order:  the
  12836.                     current directory, the INIT directory on C, and the
  12837.                     CONFIG directory on D:
  12838.  
  12839.                          [c:\] dpath c:\init;d:\config
  12840.  
  12841.                     The listing of directories to be searched can be set
  12842.                     or viewed with DPATH.  The list is stored as an
  12843.                     environment string with the variable name DPATH, and
  12844.                     can also be set or viewed with the SET command and
  12845.                     edited with the ESET command.
  12846.  
  12847.                     Directory names in the DPATH must be separated with
  12848.                     semicolons [;].  4OS2 and 4DOS/NT will not shift
  12849.                     directory names in the DPATH to upper case as they do
  12850.                     with those in the PATH setting.  If you want the names
  12851.                     in the DPATH to be in upper case you must enter them
  12852.                     that way.
  12853.  
  12854.                     If you enter DPATH with no parameters, 4OS2 and 4DOS
  12855.                     /NT display the current DPATH search list.
  12856.  
  12857.  
  12858.  
  12859.  
  12860.  
  12861.  
  12862.  
  12863.  
  12864.         -------------------------------------------------------------------
  12865.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 218
  12866.                                                                     DRAWBOX
  12867.         -------------------------------------------------------------------
  12868.  
  12869.  
  12870.         DRAWBOX                                                       (New)
  12871.  
  12872.         Purpose:    Draw a box on the screen.
  12873.  
  12874.         Format:     DRAWBOX ulrow ulcol lrrow lrcol style [BRIght] [BLInk]
  12875.                          fg ON [BRIght] bg [FILl [BRIght] bgfill] [ZOOm]
  12876.                     [SHAdow]
  12877.  
  12878.                     ulrow:  Row for upper left corner
  12879.                     ulcol:  Column for upper left corner
  12880.                     lrrow:  Row for lower right corner
  12881.                     lrcol:  Column for lower right corner
  12882.                     style:  Box drawing style:
  12883.                          0    No lines (box is drawn with blanks)
  12884.                          1    Single line
  12885.                          2    Double line
  12886.                          3    Single on top and bottom, double on sides
  12887.                          4    Double on top and bottom, single on sides
  12888.                     fg:  Foreground character color
  12889.                     bg:  Background character color
  12890.                     bgfill:  Background fill color (for the inside of the
  12891.                     box)
  12892.  
  12893.                     See also:  DRAWHLINE and DRAWVLINE.
  12894.  
  12895.         Usage:      DRAWBOX is useful for creating attractive screen
  12896.                     displays in batch files.
  12897.  
  12898.                     For example, to draw a box around the entire screen
  12899.                     with bright white lines on a blue background:
  12900.  
  12901.                          drawbox 0 0 24 79 1 bri whi on blu fill blu
  12902.  
  12903.                     See page 26 for details about colors and color names,
  12904.                     and notes on the use of bright background colors.
  12905.  
  12906.                     If you use ZOOM, the box appears to grow in steps to
  12907.                     its final size.  The speed of the zoom operation
  12908.                     depends on the speed of your video system.
  12909.  
  12910.                     If you use SHADOW, a drop shadow is created by
  12911.                     changing the characters in the row under the box and
  12912.                     the 2 columns to the right of the box to normal
  12913.                     intensity text with a black background (this will make
  12914.                     characters displayed in black disappear entirely).
  12915.  
  12916.                     The row and column values are zero-based, so on a
  12917.                     standard 25 line by 80 column display, valid rows are
  12918.                     0 - 24 and valid columns are 0 - 79.
  12919.  
  12920.  
  12921.         -------------------------------------------------------------------
  12922.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 219
  12923.                                                                     DRAWBOX
  12924.         -------------------------------------------------------------------
  12925.  
  12926.  
  12927.                     DRAWBOX checks for valid row and column values, and
  12928.                     displays a "Usage" error message if any values are out
  12929.                     of range.
  12930.  
  12931.                     Unlike DRAWHLINE and DRAWVLINE, DRAWBOX does not
  12932.                     automatically connect boxes to existing lines on the
  12933.                     screen with the proper connector characters.  If you
  12934.                     want to draw lines inside a box and have the proper
  12935.                     connectors drawn automatically, draw the box first,
  12936.                     then use DRAWHLINE and DRAWVLINE to draw the lines.
  12937.  
  12938.                     DRAWBOX uses the standard line and box drawing
  12939.                     characters in the U.S. English extended ASCII
  12940.                     character set.  If your system is configured for a
  12941.                     different country or language, the box may not appear
  12942.                     on your screen as you expect.
  12943.  
  12944.             4DOS ## DRAWBOX normally writes text directly to the screen.
  12945.                     If you have an unusual display adapter which does not
  12946.                     support direct video output, see the OutputBIOS
  12947.                     directive on page 150.
  12948.  
  12949.  
  12950.  
  12951.  
  12952.  
  12953.  
  12954.  
  12955.  
  12956.  
  12957.  
  12958.  
  12959.  
  12960.  
  12961.  
  12962.  
  12963.  
  12964.  
  12965.  
  12966.  
  12967.  
  12968.  
  12969.  
  12970.  
  12971.  
  12972.  
  12973.  
  12974.  
  12975.  
  12976.  
  12977.  
  12978.         -------------------------------------------------------------------
  12979.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 220
  12980.                                                                   DRAWHLINE
  12981.         -------------------------------------------------------------------
  12982.  
  12983.  
  12984.         DRAWHLINE                                                     (New)
  12985.  
  12986.         Purpose:    Draw a horizontal line on the screen.
  12987.  
  12988.         Format:     DRAWHLINE row column len style [BRIght] [BLInk]
  12989.                          fg ON [BRIght] bg
  12990.  
  12991.                     row:  Starting row
  12992.                     column:  Starting column
  12993.                     len:  Length of line
  12994.                     style:  Line drawing style:
  12995.                          1    Single line
  12996.                          2    Double line
  12997.                     fg:  Foreground character color
  12998.                     bg:  Background character color
  12999.  
  13000.                     See also:  DRAWBOX and DRAWVLINE.
  13001.  
  13002.         Usage:      DRAWHLINE is useful for creating attractive screen
  13003.                     displays in batch files.  It detects other lines and
  13004.                     boxes on the display, and creates the appropriate
  13005.                     connector characters when possible (not all types of
  13006.                     lines can be connected with the available characters).
  13007.  
  13008.                     For example, the following command draws a double line
  13009.                     along the top row of the display with green characters
  13010.                     on a blue background:
  13011.  
  13012.                          drawhline 0 0 80 2 green on blue
  13013.  
  13014.                     The row and column values are zero-based, so on a
  13015.                     standard 25 line by 80 column display, valid rows are
  13016.                     0 - 24 and valid columns are 0 - 79.  DRAWHLINE checks
  13017.                     for a valid row and column, and displays a "Usage"
  13018.                     error message if either value is out of range.
  13019.  
  13020.                     See page 26 for details about colors and color names,
  13021.                     and notes on the use of bright background colors.
  13022.  
  13023.                     DRAWHLINE uses the standard line and box drawing
  13024.                     characters in the U.S. English extended ASCII
  13025.                     character set.  If your system is configured for a
  13026.                     different country or language, the line may not appear
  13027.                     on your screen as you expect.
  13028.  
  13029.           4DOS  ##  DRAWHLINE normally writes text directly to the screen.
  13030.                     If you have an unusual display adapter which does not
  13031.                     support direct video output, see the OutputBIOS
  13032.                     directive on page 150.
  13033.  
  13034.  
  13035.         -------------------------------------------------------------------
  13036.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 221
  13037.                                                                   DRAWVLINE
  13038.         -------------------------------------------------------------------
  13039.  
  13040.  
  13041.         DRAWVLINE                                                     (New)
  13042.  
  13043.         Purpose:    Draw a vertical line on the screen.
  13044.  
  13045.         Format:     DRAWVLINE row column len style [BRIght][BLInk]
  13046.                          fg ON [BRIght] bg
  13047.  
  13048.                     row:  Starting row
  13049.                     column:  Starting column
  13050.                     len:  Length of line
  13051.                     style:  Line drawing style:
  13052.                          1    Single line
  13053.                          2    Double line
  13054.                     fg:  Foreground character color
  13055.                     bg:  Background character color
  13056.  
  13057.                     See also:  DRAWBOX and DRAWHLINE.
  13058.  
  13059.         Usage:      DRAWVLINE is useful for creating attractive screen
  13060.                     displays in batch files.  It detects other lines and
  13061.                     boxes on the display, and creates the appropriate
  13062.                     connector characters when possible (not all types of
  13063.                     lines can be connected with the available characters).
  13064.  
  13065.                     For example, to draw a double width line along the
  13066.                     left margin of the display with bright red characters
  13067.                     on a black background:
  13068.  
  13069.                          drawvline 0 0 25 2 bright red on black
  13070.  
  13071.                     The row and column values are zero-based, so on a
  13072.                     standard 25 line by 80 column display, valid rows are
  13073.                     0 - 24 and valid columns are 0 - 79.  DRAWVLINE checks
  13074.                     for a valid row and column, and displays a "Usage"
  13075.                     error message if either value is out of range.
  13076.  
  13077.                     See page 26 for details about colors and color names,
  13078.                     and notes on the use of bright background colors.
  13079.  
  13080.                     DRAWVLINE uses the standard line and box drawing
  13081.                     characters in the U.S. English extended ASCII
  13082.                     character set.  If your system is configured for a
  13083.                     different country or language, the line may not appear
  13084.                     on your screen as you expect.
  13085.  
  13086.           4DOS  ##  DRAWVLINE normally writes text directly to the screen.
  13087.                     If you have an unusual display adapter which does not
  13088.                     support direct video output, see the OutputBIOS
  13089.                     directive on page 150.
  13090.  
  13091.  
  13092.         -------------------------------------------------------------------
  13093.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 222
  13094.                                                                        ECHO
  13095.         -------------------------------------------------------------------
  13096.  
  13097.  
  13098.         ECHO                                                     (Enhanced)
  13099.  
  13100.         Purpose:    Display a message, enable or disable batch file or
  13101.                     command-line echoing, or display the echo status.
  13102.  
  13103.         Format:     ECHO [ON | OFF | message]
  13104.  
  13105.                     message:  Text to display.
  13106.  
  13107.                     See also:  ECHOS, SCREEN, SCRPUT, SETDOS and TEXT.
  13108.  
  13109.         Usage:      4DOS, 4OS2, and 4DOS/NT have a separate echo
  13110.                     capability for batch files and for the command line.
  13111.                     The command-line ECHO state is independent of the
  13112.                     batch file ECHO state; changing ECHO in a batch file
  13113.                     has no effect on the display at the command prompt,
  13114.                     and vice versa.
  13115.  
  13116.                     To see the current echo state, use the ECHO command
  13117.                     with no arguments.  This displays either the batch
  13118.                     file or command-line echo state, depending on where
  13119.                     the ECHO command is performed.
  13120.  
  13121.                     In a batch file, if you turn ECHO on, each line of the
  13122.                     file is displayed before it is executed.  If you turn
  13123.                     ECHO off, each line is executed without being
  13124.                     displayed.  ECHO can also be used in a batch file to
  13125.                     display a message on the screen.  Regardless of the
  13126.                     ECHO state, a batch file line that begins with the [@]
  13127.                     character will not be displayed.  To turn off batch
  13128.                     file echoing, without displaying the ECHO command, use
  13129.                     this line:
  13130.  
  13131.                          @echo off
  13132.  
  13133.                     ECHO commands in a batch file will send messages to
  13134.                     the screen while the batch file executes, even if ECHO
  13135.                     is set OFF.  For example, this line will display a
  13136.                     message in a batch file:
  13137.  
  13138.                          echo Processing your print files...
  13139.  
  13140.                     If you want to echo a blank line from within a batch
  13141.                     file, enter:
  13142.  
  13143.                          echo.
  13144.  
  13145.                     You cannot use the command separator character ([^] in
  13146.                     4DOS or [&] in 4OS2 and 4DOS/NT) or the redirection
  13147.                     symbols (| > <) in an ECHO message, unless you enclose
  13148.  
  13149.         -------------------------------------------------------------------
  13150.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 223
  13151.                                                                        ECHO
  13152.         -------------------------------------------------------------------
  13153.  
  13154.  
  13155.                     them in quotes (see page 123) or precede them with the
  13156.                     escape character (see page 73).
  13157.  
  13158.                     ECHO defaults to ON in batch files.  The current ECHO
  13159.                     state is inherited by called batch files.  You can
  13160.                     change the default setting to ECHO OFF with the SETDOS
  13161.                     /V0 command or the BatchEcho directive in the .INI
  13162.                     file (see page 137).
  13163.  
  13164.                     If you turn the command-line ECHO on, each command
  13165.                     will be displayed before it is executed.  This will
  13166.                     let you see the command line after expansion of all
  13167.                     aliases and variables.  The command-line ECHO is most
  13168.                     useful when you are learning how to use advanced
  13169.                     features.  This example will turn command-line echoing
  13170.                     on:
  13171.  
  13172.                          c:\> echo on
  13173.  
  13174.                     ECHO defaults to OFF at the command line.
  13175.  
  13176.  
  13177.  
  13178.  
  13179.  
  13180.  
  13181.  
  13182.  
  13183.  
  13184.  
  13185.  
  13186.  
  13187.  
  13188.  
  13189.  
  13190.  
  13191.  
  13192.  
  13193.  
  13194.  
  13195.  
  13196.  
  13197.  
  13198.  
  13199.  
  13200.  
  13201.  
  13202.  
  13203.  
  13204.  
  13205.  
  13206.         -------------------------------------------------------------------
  13207.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 224
  13208.                                                                       ECHOS
  13209.         -------------------------------------------------------------------
  13210.  
  13211.  
  13212.         ECHOS                                                         (New)
  13213.  
  13214.         Purpose:    Display a message without a trailing carriage return
  13215.                     and line feed.
  13216.  
  13217.         Format:     ECHOS message
  13218.  
  13219.                     See also:  ECHO, SCREEN, SCRPUT, TEXT, and VSCRPUT.
  13220.  
  13221.         Usage:      ECHOS is useful for text output when you don't want to
  13222.                     add a carriage return / linefeed pair at the end of
  13223.                     the line.  For example, you can use ECHOS when you
  13224.                     need to redirect control sequences to your printer;
  13225.                     this example sends the sequence Esc P to the printer
  13226.                     on LPT1:
  13227.  
  13228.                          c:\> echos <Ctrl-X>eP > lpt1:
  13229.  
  13230.                     You cannot use the command separator character ([^] in
  13231.                     4DOS and [&] in 4OS2 and 4DOS/NT) or the redirection
  13232.                     symbols [|><] in an ECHOS message, unless you enclose
  13233.                     them in quotes (see page 123) or precede them with the
  13234.                     escape character (see page 73).
  13235.  
  13236.                ##   ECHOS does not translate or modify the message text.
  13237.                     For example, carriage return characters are not
  13238.                     translated to CR/LF pairs.  ECHOS sends only the
  13239.                     characters you enter (after escape character and back-
  13240.                     quote processing).  The only character you cannot put
  13241.                     into an ECHOS message is the NUL character (ASCII 0).
  13242.  
  13243.  
  13244.  
  13245.  
  13246.  
  13247.  
  13248.  
  13249.  
  13250.  
  13251.  
  13252.  
  13253.  
  13254.  
  13255.  
  13256.  
  13257.  
  13258.  
  13259.  
  13260.  
  13261.  
  13262.  
  13263.         -------------------------------------------------------------------
  13264.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 225
  13265.                                                                    ENDLOCAL
  13266.         -------------------------------------------------------------------
  13267.  
  13268.  
  13269.         ENDLOCAL                                                      (New)
  13270.  
  13271.         Purpose:    Restore the saved disk drive, directory, environment,
  13272.                     and alias list.
  13273.  
  13274.         Format:     ENDLOCAL
  13275.  
  13276.                     See also:  SETLOCAL.
  13277.  
  13278.         ##  Usage:  The SETLOCAL command in a batch file saves the current
  13279.                     disk drive, default directory, all environment
  13280.                     variables, and the alias list.  ENDLOCAL restores
  13281.                     everything that was saved by the previous SETLOCAL
  13282.                     command.
  13283.  
  13284.                     For example, this batch file fragment saves the drive,
  13285.                     current working directory, and environment variables,
  13286.                     removes all aliases so that any user aliases will not
  13287.                     affect batch file commands, changes the drive and
  13288.                     directory, sets some environment variables, runs the
  13289.                     program TEST1, and then restores the original values:
  13290.  
  13291.                          setlocal
  13292.                          unalias *
  13293.                          cdd d:\test
  13294.                          set path=c:\;c:\dos;c:\util
  13295.                          set lib=d:\lib
  13296.                          test1
  13297.                          endlocal
  13298.  
  13299.                     SETLOCAL and ENDLOCAL can only be used in batch files,
  13300.                     not in aliases or from the command line.
  13301.  
  13302.  
  13303.  
  13304.  
  13305.  
  13306.  
  13307.  
  13308.  
  13309.  
  13310.  
  13311.  
  13312.  
  13313.  
  13314.  
  13315.  
  13316.  
  13317.  
  13318.  
  13319.  
  13320.         -------------------------------------------------------------------
  13321.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 226
  13322.                                                                        ESET
  13323.         -------------------------------------------------------------------
  13324.  
  13325.  
  13326.         ESET                                                          (New)
  13327.  
  13328.         Purpose:    Edit environment variables and aliases.
  13329.  
  13330.         Format:     ESET [/A /M] variable name...
  13331.  
  13332.                     variable name:  The name of an environment variable or
  13333.                     alias to edit.
  13334.  
  13335.                     /A(lias)            /M(aster environment)
  13336.  
  13337.                     See also:  ALIAS, UNALIAS, SET, and UNSET.
  13338.  
  13339.         Usage:      ESET allows you to edit environment variables and
  13340.                     aliases using line editing commands (see page 35).
  13341.  
  13342.                     For example, to edit the executable file search path:
  13343.  
  13344.                          c:\> eset path
  13345.                          path=c:\;c:\dos;c:\util
  13346.                               -
  13347.  
  13348.                     To create and then edit an alias:
  13349.  
  13350.                          c:\> alias d = dir /d/j/p
  13351.                          c:\> eset d
  13352.                          d=dir /d/j/p
  13353.                            -
  13354.  
  13355.                     ESET will search for environment variables first and
  13356.                     then aliases.  If you have an environment variable and
  13357.                     an alias with the same name, ESET will edit the
  13358.                     environment variable and ignore the alias unless you
  13359.                     use the /A option.
  13360.  
  13361.                     Environment variable and alias names are normally
  13362.                     limited to 80 characters, and their contents to 255
  13363.                     characters in 4DOS, or 1,023 characters in 4OS2 and
  13364.                     4DOS/NT.  However, if you use special techniques to
  13365.                     create a longer environment variable, ESET will edit
  13366.                     it provided the variable contains no more than 511
  13367.                     characters of text in 4DOS, or 2,047 characters in
  13368.                     4OS2 and 4DOS/NT.
  13369.  
  13370.                     If you have enabled global aliases (see page 169), any
  13371.                     changes made to an alias with ESET will immediately
  13372.                     affect all other copies of the command processor which
  13373.                     are using the same alias list.
  13374.  
  13375.  
  13376.  
  13377.         -------------------------------------------------------------------
  13378.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 227
  13379.                                                                        ESET
  13380.         -------------------------------------------------------------------
  13381.  
  13382.  
  13383.         Option:  ## /A(lias):  Edit the named alias even if an environment
  13384.                     variable of the same name exists.  If you have an
  13385.                     alias and an environment variable with the same name,
  13386.                     you must use this switch to be able to edit the alias.
  13387.  
  13388.             4DOS    /M(aster environment):  Edit an environment variable
  13389.                     in the master environment rather than the local
  13390.                     environment.  This option is only useful from a
  13391.                     secondary command shell (for example, when an
  13392.                     application has "shelled to DOS").  /M only works for
  13393.                     environment variables; it cannot be used to edit the
  13394.                     primary shell's aliases.
  13395.  
  13396.  
  13397.  
  13398.  
  13399.  
  13400.  
  13401.  
  13402.  
  13403.  
  13404.  
  13405.  
  13406.  
  13407.  
  13408.  
  13409.  
  13410.  
  13411.  
  13412.  
  13413.  
  13414.  
  13415.  
  13416.  
  13417.  
  13418.  
  13419.  
  13420.  
  13421.  
  13422.  
  13423.  
  13424.  
  13425.  
  13426.  
  13427.  
  13428.  
  13429.  
  13430.  
  13431.  
  13432.  
  13433.  
  13434.         -------------------------------------------------------------------
  13435.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 228
  13436.                                                                      EXCEPT
  13437.         -------------------------------------------------------------------
  13438.  
  13439.  
  13440.         EXCEPT                                                        (New)
  13441.  
  13442.         Purpose:    Perform a command on all available files except those
  13443.                     specified.
  13444.  
  13445.         Format:     EXCEPT (file) command
  13446.  
  13447.                     file:  The file or files to exclude from the command.
  13448.                     command:  The command to execute, including all
  13449.                     appropriate arguments and switches.
  13450.  
  13451.                     See also:  ATTRIB.
  13452.  
  13453.         Selection:  Supports extended wildcards, ranges, multiple file
  13454.                     names, and include lists (see pages 59 - 67).  Date,
  13455.                     time, or size ranges must appear immediately after the
  13456.                     EXCEPT keyword.
  13457.  
  13458.         Usage:      EXCEPT provides a means of executing a command on a
  13459.                     group of files and/or subdirectories, and excluding a
  13460.                     subgroup from the operation.  The command can be an
  13461.                     internal command or alias, an external command, or a
  13462.                     batch file.
  13463.  
  13464.                     You may use wildcards to specify the files to exclude
  13465.                     from the command.  The first example erases all the
  13466.                     files in the current directory except those beginning
  13467.                     with MEMO, and those whose extension is .WKS.  The
  13468.                     second example copies all the files and subdirectories
  13469.                     on drive C to drive D except those in C:\MSC and
  13470.                     C:\DOS, using the COPY command:
  13471.  
  13472.                          c:\> except (memo*.* *.wks) erase *.*
  13473.                          c:\> except (c:\msc c:\dos) copy c:\*.* d:\ /s
  13474.  
  13475.                ##   Date, time, and size ranges can be used immediately
  13476.                     after the word EXCEPT to further qualify which files
  13477.                     should be excluded from the command.  If the command
  13478.                     is an internal command that supports ranges, an
  13479.                     independent range can also be used in the command
  13480.                     itself.
  13481.  
  13482.              ##  !  EXCEPT prevents operations on the specified file(s) by
  13483.                     setting the hidden attribute, performing the command,
  13484.                     and then clearing the hidden attribute.  If the
  13485.                     command is aborted in an unusual way, you may need to
  13486.                     use the ATTRIB command to remove the hidden attribute
  13487.                     from the file(s).
  13488.  
  13489.  
  13490.  
  13491.         -------------------------------------------------------------------
  13492.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 229
  13493.                                                                      EXCEPT
  13494.         -------------------------------------------------------------------
  13495.  
  13496.  
  13497.                ! ## EXCEPT will not work with programs or commands that
  13498.                     ignore the hidden attribute or which work explicitly
  13499.                     with hidden files, including DEL /Z, and the /H
  13500.                     (process hidden files) switch available in some 4DOS,
  13501.                     4OS2, and 4DOS/NT file processing commands.
  13502.  
  13503.                ##   You can use command grouping (see page 71) to execute
  13504.                     multiple commands with a single EXCEPT.  For example,
  13505.                     the following command copies all files in the current
  13506.                     directory whose extensions begin with .DA, except the
  13507.                     .DAT files, to the D:\SAVE directory, then changes the
  13508.                     first two characters of the extension of the copied
  13509.                     files to .SA.  This example should be entered on one
  13510.                     line:
  13511.  
  13512.                          c:\data> except (*.dat) (copy *.da* d:\save ^
  13513.                                   ren *.da* *.sa*)
  13514.  
  13515.                ##   If you use filename completion (see page 41) to enter
  13516.                     the filenames inside the parentheses, type a space
  13517.                     after the open parenthesis before entering a partial
  13518.                     filename or pressing Tab.  Otherwise, the command-line
  13519.                     editor will treat the open parenthesis as the first
  13520.                     character of the filename to be completed.
  13521.  
  13522.          4DOS ## !  If you receive a stack overflow error when using
  13523.                     EXCEPT in complex, nested command sequences, see the
  13524.                     notes under the StackSize directive on page 150.
  13525.  
  13526.  
  13527.  
  13528.  
  13529.  
  13530.  
  13531.  
  13532.  
  13533.  
  13534.  
  13535.  
  13536.  
  13537.  
  13538.  
  13539.  
  13540.  
  13541.  
  13542.  
  13543.  
  13544.  
  13545.  
  13546.  
  13547.  
  13548.         -------------------------------------------------------------------
  13549.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 230
  13550.                                                                        EXIT
  13551.         -------------------------------------------------------------------
  13552.  
  13553.  
  13554.         EXIT                                                     (Enhanced)
  13555.  
  13556.         Purpose:    Return from the command processor.
  13557.  
  13558.         Format:     EXIT [value]
  13559.  
  13560.                     value:  The exit code to return (0 - 255).
  13561.  
  13562.         Usage:      EXIT terminates the current copy of the command
  13563.                     processor.  Use it to return to an application when
  13564.                     you have "shelled out" to work at the prompt, or to
  13565.                     end a command-line session under Windows, OS/2, or
  13566.                     Windows NT.
  13567.  
  13568.                     To close the session, or to return to the application
  13569.                     that started the command processor, type:
  13570.  
  13571.                          c:\> exit
  13572.  
  13573.                ##   If you specify a value, EXIT will return that value to
  13574.                     the program that started the command processor.  For
  13575.                     example:
  13576.  
  13577.                          c:\> exit 255
  13578.  
  13579.                ##   The value is a number you can use to inform the
  13580.                     program of some result, such as the success or failure
  13581.                     of a batch file.  This feature is most useful for
  13582.                     systems which use batch files to automate their
  13583.                     operation, such as bulletin boards, or custom
  13584.                     application programs like databases that shell to the
  13585.                     command processor to perform certain tasks.
  13586.  
  13587.            4DOS ##  You cannot EXIT from the primary 4DOS shell under DOS.
  13588.                     If EXIT does not seem to have any effect, you are
  13589.                     probably in the primary shell.
  13590.  
  13591.  
  13592.  
  13593.  
  13594.  
  13595.  
  13596.  
  13597.  
  13598.  
  13599.  
  13600.  
  13601.  
  13602.  
  13603.  
  13604.  
  13605.         -------------------------------------------------------------------
  13606.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 231
  13607.                                                                       FFIND
  13608.         -------------------------------------------------------------------
  13609.  
  13610.  
  13611.         FFIND                                                         (New)
  13612.  
  13613.         Purpose:    Search for files by name or contents.
  13614.  
  13615.         Format:     FFIND [/A[[:][-]rhsda] /B /C /D[list] /E /K /L /M
  13616.                     /O[[:][-]acdeginrsu] /P /S /[T|X]"xx" /V] file...
  13617.  
  13618.                     list:  A list of disk drive letters (without colons).
  13619.                     file:  The file, directory, or list of files or
  13620.                     directories to display.
  13621.  
  13622.                     /A(ttribute select)      /M (no footers)
  13623.                     /B(are)                  /O(rder)
  13624.                     /C(ase sensitive)        /P(ause)
  13625.                     /D(rive)                 /S(ubdirectories)
  13626.                     /E (upper case display)  /T"xx" (text search string)
  13627.                     /K (no headers)          /V(erbose)
  13628.                     /L(ine numbers)          /X["xx"] (hex display /
  13629.                     search string)
  13630.  
  13631.         Selection:  Supports extended wildcards, ranges, multiple file
  13632.                     names, and include lists (see pages 59 - 67).
  13633.  
  13634.         Usage:      FFIND is a flexible search command that looks for
  13635.                     files based on their names and their contents.
  13636.                     Depending on the options you choose, FFIND can display
  13637.                     filenames, matching text, or a combination of both in
  13638.                     a variety of formats.
  13639.  
  13640.                     If you want to search for files by name, FFIND works
  13641.                     much like the DIR command.  For example, to generate a
  13642.                     list of all the .BTM files in the current directory,
  13643.                     you could use the command
  13644.  
  13645.                          c:\> ffind *.btm
  13646.  
  13647.                     The output from this command is a list of full
  13648.                     pathnames, followed by the number of files found.
  13649.  
  13650.                     If you want to limit the output to a list of *.BTM
  13651.                     files which contain the string color, you could use
  13652.                     this command instead:
  13653.  
  13654.                          c:\> ffind /t"color" *.btm
  13655.  
  13656.                     The output from this version of FFIND is a list of
  13657.                     files that contain the string color along with the
  13658.                     first line in each file that contains that string.  By
  13659.                     default, FFIND uses a case-insensitve search, so the
  13660.                     command above will include files that contain COLOR,
  13661.  
  13662.         -------------------------------------------------------------------
  13663.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 232
  13664.                                                                       FFIND
  13665.         -------------------------------------------------------------------
  13666.  
  13667.  
  13668.                     Color, color, or any other combination of upper-case
  13669.                     and lower-case letters.
  13670.  
  13671.                     You can use extended wildcards in the search string to
  13672.                     increase the flexibility of FFIND's search.  For
  13673.                     example, the following command will find .TXT files
  13674.                     which contain either the string June or July (it will
  13675.                     also find Juny and Jule).  The /C option makes the
  13676.                     search case-sensitive:
  13677.  
  13678.                          c:\> ffind /c/t"Ju[nl][ey]" *.txt
  13679.  
  13680.                     At times, you may need to search for data that cannot
  13681.                     be represented by ASCII characters.  You can use
  13682.                     FFIND's /X option to represent the search string in
  13683.                     hexadecimal format. With /X, the search must be
  13684.                     represented by pairs of hexadecimal digits separated
  13685.                     by spaces; a search of this type is always case-
  13686.                     sensitive (41 63 65 is the hex code for "Ace"):""
  13687.  
  13688.                          c:\> ffind /x"41 63 65" *.txt
  13689.  
  13690.                     You can use FFIND's other options to further specify
  13691.                     the files for which you are searching and to modify
  13692.                     the way in which the output is displayed.
  13693.  
  13694.             4DOS ## If you are using a disk compression program, you can
  13695.                     sort the display by compression ratios with the /O:c
  13696.                     switch. See APPNOTES.DOC for a list of supported
  13697.                     compression systems.
  13698.  
  13699.         Options:    /A(ttribute select):  Find only those files that have
  13700.                     the specified attribute(s) set.  Preceding the
  13701.                     attribute character with a hyphen [-] will display
  13702.                     files that do not have that attribute set.  The
  13703.                     attributes are:
  13704.  
  13705.                          R    Read-only         D    Subdirectory
  13706.                          H    Hidden            A    Archive
  13707.                          S    System
  13708.  
  13709.                     If no attributes are listed at all (e.g., FFIND /A
  13710.                     ...), FFIND will search all files and subdirectories
  13711.                     including hidden and system files.  If attributes are
  13712.                     combined, all the specified attributes must match for
  13713.                     a file to be included in the listing.  For example,
  13714.                     /A:RHS will search only those files with all three
  13715.                     attributes set.  See page 18 for more information on
  13716.                     file attributes.
  13717.  
  13718.  
  13719.         -------------------------------------------------------------------
  13720.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 233
  13721.                                                                       FFIND
  13722.         -------------------------------------------------------------------
  13723.  
  13724.  
  13725.                     /B(are):  Display file names only and omit the text
  13726.                     that matches the search.  This option is only useful
  13727.                     in combination with /T or /X, which normally force
  13728.                     FFIND to display file names and matching text.
  13729.  
  13730.                     /C(ase sensitive):  Perform a case-sensitive search.
  13731.                     This option is only valid with /T, which defaults to a
  13732.                     case-insenitive search.  It is not needed with a /X
  13733.                     hexadecimal search, which is always case-sensitive.
  13734.  
  13735.                     /D(rive):  Search all files on one or more drives.  If
  13736.                     you use /D without a list of drives, FFIND will search
  13737.                     the drives specified in the list of files.  If no
  13738.                     drive letters are listed, FFIND will search the
  13739.                     default drive.  You can include a list of drives or a
  13740.                     range of drives to search as part of the /D option.
  13741.                     For example, to search drives C:, D:, E:, and G:, you
  13742.                     can use either of these commands:
  13743.  
  13744.                          c:\> ffind /dcdeg ...
  13745.                          c:\> ffind /dc-eg ...
  13746.  
  13747.                     /E:  Display filenames in the traditional upper case;
  13748.                     also see SETDOS /U (page 326) and the UpperCase
  13749.                     directive in 4DOS.INI (page 141).
  13750.  
  13751.                     /K (No headers):  Suppress the display of the header
  13752.                     or filename for each matching text line.
  13753.  
  13754.                     /L(ine numbers):  Include the line number for each
  13755.                     text line displayed.
  13756.  
  13757.                     /M (No footers):  Suppress the footer (the number of
  13758.                     files and number of matches) at the end of FFIND's
  13759.                     display.
  13760.  
  13761.                     /O(rder):  Set the sort order for the files that FFIND
  13762.                     displays.  You may use any combination of the
  13763.                     following sorting options; if multiple options are
  13764.                     used, the listing will be sorted with the first sort
  13765.                     option as the primary key, the next as the secondary
  13766.                     key, and so on:
  13767.  
  13768.                          -    Reverse the sort order for the next option
  13769.                          a    Sort names and extensions in standard ASCII
  13770.                               order, rather than sorting numerically when
  13771.                               digits are included in the name or
  13772.                               extension.
  13773.  
  13774.  
  13775.  
  13776.         -------------------------------------------------------------------
  13777.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 234
  13778.                                                                       FFIND
  13779.         -------------------------------------------------------------------
  13780.  
  13781.  
  13782.           4DOS           c    Sort by compression ratio (the least
  13783.                               compressed file in the list will be
  13784.                               displayed first).
  13785.                          d    Sort by date and time (oldest first); for
  13786.                               HPFS and NTFS drives also see /T.
  13787.                          e    Sort by extension.
  13788.                          g    Group subdirectories first, then files.
  13789.                          i    Sort by the file description (ignored if /C
  13790.                               or /O:c is also used).
  13791.                          n    Sort by filename (this is the default).
  13792.                          r    Reverse the sort order for all options.
  13793.                          s    Sort by size.
  13794.                          u    Unsorted.
  13795.  
  13796.                     /P(ause):  Wait for a key to be pressed after each
  13797.                     screen page before continuing the display.  Your
  13798.                     options at the prompt are explained in detail on page
  13799.                       .                    50
  13800.  
  13801.                     /S(ubdirectories):  Display matches from the current
  13802.                     directory and all of its subdirectories.
  13803.  
  13804.                     /T"xx" (Text search):  Specify the text search string.
  13805.                     /T must be followed by a text string in double quotes
  13806.                     (e.g., /t"color").  FFIND will perform a case-
  13807.                     insensitive search unless you also use the /C option.
  13808.                     For a hexadecimal search and/or hexadecimal display of
  13809.                     the location where the search string is found, see /X.
  13810.                     You can specify a search string with either /T or /X,
  13811.                     but not both.
  13812.  
  13813.                     /V(erbose):  Show every matching line.  FFIND's
  13814.                     default behavior is to show only the first matching
  13815.                     line then and then go on to the next file.  This
  13816.                     option is only valid with /T or /X.
  13817.  
  13818.                     /X["xx"] (Hexadecimal display / search):  Specify
  13819.                     hexadecimal display and an optional hexadecimal search
  13820.                     string.
  13821.  
  13822.                     If /X is followed by one or more pairs of hexadecimal
  13823.                     digits in quotes (e.g., /x"44 63 65"), FFIND will
  13824.                     search for that exact sequence of characters or data
  13825.                     bytes without regard to the meaning of those bytes as
  13826.                     text.  If those bytes are found, the offset is
  13827.                     displayed (also in hexadecimal).  A search of this
  13828.                     type will always be case-sensitive.
  13829.  
  13830.                     If /X is not followed by a hexadecimal search string
  13831.                     it must be used in conjunction with /T, and will
  13832.  
  13833.         -------------------------------------------------------------------
  13834.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 235
  13835.                                                                       FFIND
  13836.         -------------------------------------------------------------------
  13837.  
  13838.  
  13839.                     change the output format to display hexadecimal
  13840.                     offsets rather than actual text lines when the search
  13841.                     string is found.  For example, this command uses /T to
  13842.                     display the first line in each BTM file containing the
  13843.                     word "hello":
  13844.  
  13845.                          c:\>ffind /t"hello" *.btm
  13846.                          ---- c:\test.btm
  13847.                          echo hello
  13848.  
  13849.                              1 line in 1 file
  13850.  
  13851.                     If you use the same command with /X, the hexadecimal
  13852.                     offset is displayed instead of the text:
  13853.  
  13854.                          c:\>ffind /t"hello" /x *.btm
  13855.                          ---- c:\test.btm
  13856.                          Offset: 1A
  13857.  
  13858.                          1 line in 1 file
  13859.  
  13860.                     You can specify a search string with either /T or /X,
  13861.                     but not both.
  13862.  
  13863.  
  13864.  
  13865.  
  13866.  
  13867.  
  13868.  
  13869.  
  13870.  
  13871.  
  13872.  
  13873.  
  13874.  
  13875.  
  13876.  
  13877.  
  13878.  
  13879.  
  13880.  
  13881.  
  13882.  
  13883.  
  13884.  
  13885.  
  13886.  
  13887.  
  13888.  
  13889.  
  13890.         -------------------------------------------------------------------
  13891.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 236
  13892.                                                                         FOR
  13893.         -------------------------------------------------------------------
  13894.  
  13895.  
  13896.         FOR                                                      (Enhanced)
  13897.  
  13898.         Purpose:    Repeat a command for several values of a variable.
  13899.  
  13900.         Format:     FOR [/A[[:][-]rhsda] /D /H] %var IN ([@]set) [DO]
  13901.                     command ...
  13902.  
  13903.                     %var:  The variable to be used in the command ("FOR
  13904.                     variable").
  13905.                     set:  A set of values for the variable.
  13906.                     command:  A command or group of commands to be
  13907.                     executed for each value of the variable.
  13908.  
  13909.                     /A(ttribute select)      /H(ide dots)
  13910.                     /D(isable "/")
  13911.  
  13912.         Selection:  Supports extended wildcards, ranges, multiple file
  13913.                     names, and include lists (see pages 59 - 67).  Date,
  13914.                     time, or size ranges must appear immediately after the
  13915.                     FOR keyword.
  13916.  
  13917.         Usage:      FOR begins by creating a set.  It then executes a
  13918.                     command for every member of the set.  The command can
  13919.                     be an internal command, an alias, an external command,
  13920.                     or a batch file.
  13921.  
  13922.                     Normally, the set is a list of files specified with
  13923.                     wildcards.  For example, if you use this line in a
  13924.                     batch file:
  13925.  
  13926.                          for %x in (*.txt) do list %x
  13927.  
  13928.                     then LIST will be executed once for each file in the
  13929.                     current directory with the extension .TXT.  The FOR
  13930.                     variable %x is set equal to each of the file names in
  13931.                     turn, then the LIST command is executed for each file.
  13932.                     (You could do the same thing more easily with a simple
  13933.                     LIST *.TXT.  We used FOR here so you could get a feel
  13934.                     for how it operates, using a simple example.)
  13935.  
  13936.                     The set can include multiple files or an include list,
  13937.                     like this:
  13938.  
  13939.                          for %x in (d:\*.txt;*.doc;*.asc) do type %x
  13940.  
  13941.                     If the set includes filenames, the file list can be
  13942.                     further refined by using date, time, and size ranges
  13943.                     (see page 62).  The range must be placed immediately
  13944.                     after the word FOR.  The range will be ignored if no
  13945.                     wildcards are used inside the parentheses.  For
  13946.  
  13947.         -------------------------------------------------------------------
  13948.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 237
  13949.                                                                         FOR
  13950.         -------------------------------------------------------------------
  13951.  
  13952.  
  13953.                     example, this set is made up of all of the *.TXT files
  13954.                     that were created or updated on October 4, 1993:
  13955.  
  13956.                          for /[d10-4-93,+0] %x in (*.txt) do ...
  13957.  
  13958.                     If the command is an internal command that supports
  13959.                     ranges, an independent range can also be used in the
  13960.                     command itself.
  13961.  
  13962.                     The set can also be made up of text instead of file
  13963.                     names.  For example, to display the free space on
  13964.                     drives C:, D:, and E:, you could use:
  13965.  
  13966.                          for %drive in (c d e) do free %drive:
  13967.  
  13968.                     When the set is made up of text or several separate
  13969.                     file names (not an include list), the elements must be
  13970.                     separated by spaces, tabs, commas, or the switch
  13971.                     character (normally a slash [/]).
  13972.  
  13973.                ##   You can also set the FOR variable equal to each line
  13974.                     in a file by placing an [@] in front of the file name.
  13975.                     If you have a file called DRIVES.TXT that contains a
  13976.                     list of drives on your computer, one drive name per
  13977.                     line (with a ":" after each drive letter), you can
  13978.                     print the free space on each drive this way:
  13979.  
  13980.                          for %d in (@drives.txt) do free %d > prn
  13981.  
  13982.                ##   Because the [@] is also a valid filename character,
  13983.                     FOR first checks to see if the file exists with the
  13984.                     [@] in its name (i.e., a file named @DRIVES.TXT).  If
  13985.                     so, the filename is treated as a normal argument.  If
  13986.                     it doesn't exist, FOR uses the filename (without the
  13987.                     [@]) as the file from which to retrieve text.
  13988.  
  13989.                ##   You can use either % or %% in front of the variable
  13990.                     name.  Either form will work, whether the FOR command
  13991.                     is typed from the command line or is part of an alias
  13992.                     or batch file (some of the traditional command
  13993.                     processors require a single % if FOR is used at the
  13994.                     command line, but use %% if it is used in a batch
  13995.                     file).  The variable name can be up to 80 characters
  13996.                     long.  The word DO is optional.
  13997.  
  13998.                ##   If you use a single-character FOR variable name, that
  13999.                     name is given priority over any environment variable
  14000.                     which starts with the same letter, in order to
  14001.                     maintain compatibility with the traditional FOR
  14002.                     command.  For example, the following command tries to
  14003.  
  14004.         -------------------------------------------------------------------
  14005.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 238
  14006.                                                                         FOR
  14007.         -------------------------------------------------------------------
  14008.  
  14009.  
  14010.                     add a: and b: to the end of the PATH, but will not
  14011.                     work as intended:
  14012.  
  14013.                          c:\> for %p in (a: b:) do path %path;%p
  14014.  
  14015.                     The "%p" in "%path" will be interpreted as the FOR
  14016.                     variable %p followed by the text "ath", which is not
  14017.                     what was intended.  To get around this, use a
  14018.                     different letter or a longer name for the FOR
  14019.                     variable, or use square brackets around the variable
  14020.                     name (see page 97).
  14021.  
  14022.                ##   The following example uses FOR with variable functions
  14023.                     to delete the .BAK files for which a corresponding
  14024.                     .TXT file exists in the current directory (this should
  14025.                     be entered on one line):
  14026.  
  14027.                          c:\docs> for %file in (*.txt) do del
  14028.                                   %@name[%file].bak
  14029.  
  14030.                ##   You can use command grouping (see page 71) to execute
  14031.                     multiple commands for each element in the list.  For
  14032.                     example, the following command copies each .WKQ file
  14033.                     in the current directory to the D:\WKSAVE directory,
  14034.                     then changes the extension of each file in the current
  14035.                     directory to .SAV.  This should be entered on one
  14036.                     line:
  14037.  
  14038.                          c:\text> for %file in (*.wkq) do (copy %file
  14039.                                   d:\wksave\ ^ ren %file *.sav)
  14040.  
  14041.                     (Use an ampersand [&] as the separator character if
  14042.                     you are using 4OS2 or 4DOS/NT.)
  14043.  
  14044.                ##   In a batch file you can use GOSUB to execute a
  14045.                     subroutine for every element in the set.  Within the
  14046.                     subroutine, the FOR variable can be used just like any
  14047.                     environment variable.  This is a convenient way to
  14048.                     execute a complex sequence of commands for every
  14049.                     element in the set without CALLing another batch file.
  14050.  
  14051.                ##   One unusual use of FOR is to execute a collection of
  14052.                     batch files or other commands with the same parameter.
  14053.                     For example, you might want to have three batch files
  14054.                     all operate on the same data file.  The FOR command
  14055.                     could look like this (enter this on one line):
  14056.  
  14057.                          c:\> for %cmd in (filetest fileform fileprnt)
  14058.                               do %cmd datafile
  14059.  
  14060.  
  14061.         -------------------------------------------------------------------
  14062.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 239
  14063.                                                                         FOR
  14064.         -------------------------------------------------------------------
  14065.  
  14066.  
  14067.                     This line will expand to three separate commands:
  14068.  
  14069.                          filetest datafile
  14070.                          fileform datafile
  14071.                          fileprnt datafile
  14072.  
  14073.                ##   The variable that FOR uses (the %CMD in the example
  14074.                     above) is created in the environment and then erased
  14075.                     when the FOR command is done.  However, for
  14076.                     compatibility with COMMAND.COM and CMD.EXE, single-
  14077.                     character FOR variables do not overwrite existing
  14078.                     environment variables with the same name.  As a
  14079.                     result, when using a multi-character variable name you
  14080.                     must be careful not to use the name of one of your
  14081.                     environment variables as a FOR variable.  For example,
  14082.                     a command that begins
  14083.  
  14084.                          c:\> for %path in ...
  14085.  
  14086.                     will write over your current path setting and then
  14087.                     erase the path variable completely.
  14088.  
  14089.                ##   FOR statements can be nested.  Under 4DOS, the
  14090.                     permissible nesting level depends on the amount of
  14091.                     free space in 4DOS's internal stack.
  14092.  
  14093.          4DOS ! ##  If you receive a stack overflow error when using FOR
  14094.                     in complex, nested command sequences, see the notes
  14095.                     under the StackSize directive on page 150.
  14096.  
  14097.         Options: ## /A(ttribute select):  Process only those files that
  14098.                     have the specified attribute(s).  /A will be used only
  14099.                     when processing wildcard file names in the set.  It
  14100.                     will be ignored for filenames without wildcards or
  14101.                     other items in the set.  Preceding the attribute
  14102.                     character with a hyphen [-] will process files that do
  14103.                     not have that attribute set.  The attributes are:
  14104.  
  14105.                          R    Read-only         D    Subdirectory
  14106.                          H    Hidden            A    Archive
  14107.                          S    System
  14108.  
  14109.                     If no attributes are listed (e.g., FOR /A ...), FOR
  14110.                     will process all files including hidden and system
  14111.                     files.  If attributes are combined, all the specified
  14112.                     attributes must match for a file to be included.  For
  14113.                     example, /A:RHS will include only those files with all
  14114.                     three attributes set.  See page 18 for more
  14115.                     information on file attributes.
  14116.  
  14117.  
  14118.         -------------------------------------------------------------------
  14119.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 240
  14120.                                                                         FOR
  14121.         -------------------------------------------------------------------
  14122.  
  14123.  
  14124.                     For example, to process only those files with the
  14125.                     archive attribute set:
  14126.  
  14127.                          for /a:a %f in (*.*) echo %f needs a backup!
  14128.  
  14129.            4DOS ##  /D(isable "/"):  Disables the special processing of
  14130.                     the forward slash [/] character in the FOR set.
  14131.                     COMMAND.COM and 4DOS normally treat a forward slash
  14132.                     inside the set as an "escape" character, discard the
  14133.                     slash, and return the character after the slash,
  14134.                     followed by the remainder of the string.  This
  14135.                     behavior can be used in batch files to separate a
  14136.                     string into individual characters (although 4DOS
  14137.                     provides a much easier method with the %@INSTR and
  14138.                     %@SUBSTR variable functions).
  14139.  
  14140.                     The /D option must follow the FOR keyword and come
  14141.                     before the variable name. These examples show the
  14142.                     effects of /D:
  14143.  
  14144.                          c:\> for %s in (/abcdef) do echo %s
  14145.                          a
  14146.                          bcdef
  14147.  
  14148.                          c:\> for /d %s in (/abcdef) do echo %s
  14149.                          /abcdef
  14150.  
  14151.                     /H(ide dots):  Suppress the assignment of the "." and
  14152.                     ".." directories to the var.
  14153.  
  14154.  
  14155.  
  14156.  
  14157.  
  14158.  
  14159.  
  14160.  
  14161.  
  14162.  
  14163.  
  14164.  
  14165.  
  14166.  
  14167.  
  14168.  
  14169.  
  14170.  
  14171.  
  14172.  
  14173.  
  14174.  
  14175.         -------------------------------------------------------------------
  14176.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 241
  14177.                                                                        FREE
  14178.         -------------------------------------------------------------------
  14179.  
  14180.  
  14181.         FREE                                                          (New)
  14182.  
  14183.         Purpose:    Display the total disk space, total bytes used, and
  14184.                     total bytes free on the specified (or default)
  14185.                     drive(s).
  14186.  
  14187.         Format:     FREE [drive: ...]
  14188.  
  14189.                     drive:  One or more drives to include in the report.
  14190.  
  14191.                     See also:  MEMORY.
  14192.  
  14193.         Usage:      FREE provides the same disk information as the
  14194.                     external command CHKDSK, but without the wait, since
  14195.                     it does not check the integrity of the file and
  14196.                     directory structure of the disk.
  14197.  
  14198.                     A colon [:] is required after each drive letter.  This
  14199.                     example displays the status of drives A and C:
  14200.  
  14201.                          c:\> free a: c:
  14202.                           Volume in drive A: is unlabeled
  14203.                            1,213,952 bytes total disk space
  14204.                            1,115,136 bytes used
  14205.                               98,816 bytes free
  14206.                           Volume in drive C: is DEVELOPMENT
  14207.                           42,496,000 bytes total disk space
  14208.                           36,851,712 bytes used
  14209.                            5,644,288 bytes free
  14210.  
  14211.                     If you are using DOS 4.0 or later, OS/2, or Windows
  14212.                     NT, the volume serial number will appear after the
  14213.                     drive label or name.
  14214.  
  14215.             4DOS    Some DOS networks with large server disk drives (256
  14216.                     MB or more) may report disk space values that are too
  14217.                     small when FREE is used.  If this occurs, it is
  14218.                     because the network software does not report the
  14219.                     proper values to 4DOS.
  14220.  
  14221.  
  14222.  
  14223.  
  14224.  
  14225.  
  14226.  
  14227.  
  14228.  
  14229.  
  14230.  
  14231.  
  14232.         -------------------------------------------------------------------
  14233.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 242
  14234.                                                                      GLOBAL
  14235.         -------------------------------------------------------------------
  14236.  
  14237.  
  14238.         GLOBAL                                                        (New)
  14239.  
  14240.         Purpose:    Execute a command in the current directory and its
  14241.                     subdirectories.
  14242.  
  14243.         Format:     GLOBAL [/H /I /P /Q] command
  14244.  
  14245.                     command:  The command to execute, including arguments
  14246.                     and switches.
  14247.  
  14248.                     /H(idden directories)    /P(rompt)
  14249.                     /I(gnore exit codes)     /Q(uiet)
  14250.  
  14251.         Usage:      GLOBAL performs the command first in the current
  14252.                     directory and then in every subdirectory under the
  14253.                     current directory.  The command can be an internal
  14254.                     command, an alias, an external command, or a batch
  14255.                     file.
  14256.  
  14257.                     This example copies the files in every directory on
  14258.                     drive A to the directory C:\TEMP:
  14259.  
  14260.                          a:\> global copy *.* c:\temp
  14261.  
  14262.                     If you use the /P option, GLOBAL will prompt for each
  14263.                     subdirectory before performing the command.  You can
  14264.                     use this option if you want to perform the command in
  14265.                     most, but not all subdirectories of the current
  14266.                     directory.
  14267.  
  14268.                ##   You can use command grouping (see page 71) to execute
  14269.                     multiple commands in each subdirectory.  For example,
  14270.                     the following command copies each .TXT file in the
  14271.                     current directory and all of its subdirectories to
  14272.                     drive A.  It then changes the extension of each of the
  14273.                     copied files to .SAV:
  14274.  
  14275.                          c:\> global (copy *.txt a: ^ ren *.txt *.sav)
  14276.  
  14277.           4DOS ## ! If you use GLOBAL in complex, nested command
  14278.                     sequences, see the cautionary note on page 150.
  14279.  
  14280.         Options: ## /H(idden directories):  Forces GLOBAL to look for
  14281.                     hidden directories.  If you don't use this switch,
  14282.                     hidden directories are ignored.
  14283.  
  14284.                ##   /I(gnore exit codes):  If this option is not
  14285.                     specified, GLOBAL will terminate if the command
  14286.                     returns a non-zero exit code.  Use /I if you want
  14287.                     command to continue in additional subdirectories even
  14288.  
  14289.         -------------------------------------------------------------------
  14290.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 243
  14291.                                                                      GLOBAL
  14292.         -------------------------------------------------------------------
  14293.  
  14294.  
  14295.                     if it returns an error in a previous subdirectory.
  14296.                     Even if you use /I, GLOBAL will halt execution in
  14297.                     response to Ctrl-C or Ctrl-Break.
  14298.  
  14299.                     /P(rompt):  Forces GLOBAL to prompt with each
  14300.                     directory name before it performs the command.  Your
  14301.                     options at the prompt are explained in detail on page
  14302.                     50.
  14303.  
  14304.                     /Q(uiet):  Do not display the directory names as each
  14305.                     directory is processed.
  14306.  
  14307.  
  14308.  
  14309.  
  14310.  
  14311.  
  14312.  
  14313.  
  14314.  
  14315.  
  14316.  
  14317.  
  14318.  
  14319.  
  14320.  
  14321.  
  14322.  
  14323.  
  14324.  
  14325.  
  14326.  
  14327.  
  14328.  
  14329.  
  14330.  
  14331.  
  14332.  
  14333.  
  14334.  
  14335.  
  14336.  
  14337.  
  14338.  
  14339.  
  14340.  
  14341.  
  14342.  
  14343.  
  14344.  
  14345.  
  14346.         -------------------------------------------------------------------
  14347.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 244
  14348.                                                                       GOSUB
  14349.         -------------------------------------------------------------------
  14350.  
  14351.  
  14352.         GOSUB                                                         (New)
  14353.  
  14354.         Purpose:    Execute a subroutine in the current batch file.
  14355.  
  14356.         Format:     GOSUB label
  14357.  
  14358.                     label:  The batch file label at the beginning of the
  14359.                     subroutine.
  14360.  
  14361.                     See also:  CALL, GOTO and RETURN.
  14362.  
  14363.         Usage:      GOSUB can only be used in batch files.
  14364.  
  14365.                     4DOS, 4OS2, and 4DOS/NT allow subroutines in batch
  14366.                     files.  A subroutine must start with a label (a colon
  14367.                     [:] followed by a one-word label name) which appears
  14368.                     on a line by itself.  Case differences are ignored
  14369.                     when matching labels.  The subroutine must end with a
  14370.                     RETURN statement.
  14371.  
  14372.                     The subroutine is invoked with a GOSUB command from
  14373.                     another part of the batch file.  After the RETURN,
  14374.                     processing will continue with the command following
  14375.                     the GOSUB command.  For example, the following batch
  14376.                     file fragment calls a subroutine which displays the
  14377.                     directory and returns:
  14378.  
  14379.                          echo Calling a subroutine
  14380.                          gosub subr1
  14381.                          echo Returned from the subroutine
  14382.                          quit
  14383.                          :subr1
  14384.                          dir /a/w
  14385.                          return
  14386.  
  14387.                     If the label doesn't exist, the batch file is
  14388.                     terminated with the error message "Label not found."
  14389.  
  14390.                     GOSUB saves the IFF state, so IFF statements inside a
  14391.                     subroutine won't interfere with IFF statements in the
  14392.                     part of the batch file from which the subroutine was
  14393.                     called.
  14394.  
  14395.                ##   Subroutines can be nested.  Under 4DOS, the
  14396.                     permissible nesting level depends on the amount of
  14397.                     free space in 4DOS's internal stack; if you receive a
  14398.                     stack overflow error when using GOSUB in complex,
  14399.                     nested command sequences, see the notes under the
  14400.                     StackSize directive on page 150.
  14401.  
  14402.  
  14403.         -------------------------------------------------------------------
  14404.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 245
  14405.                                                                        GOTO
  14406.         -------------------------------------------------------------------
  14407.  
  14408.  
  14409.         GOTO                                                   (Compatible)
  14410.  
  14411.         Purpose:    Branch to a specified line inside the current batch
  14412.                         .                    file
  14413.  
  14414.         Format:     GOTO [/I] label
  14415.  
  14416.                     label:  The batch file label to branch to.
  14417.  
  14418.                     /I(FF and DO continue)
  14419.  
  14420.                     See also:  GOSUB.
  14421.  
  14422.         Usage:      GOTO can only be used in batch files.
  14423.  
  14424.                     After a GOTO command in a batch file, the next line to
  14425.                     be executed will be the one immediately after the
  14426.                     label.  The label must begin with a colon [:] and
  14427.                     appear on a line by itself.  The colon is required on
  14428.                     the line where the label is defined, but is not
  14429.                     required in the GOTO command itself.  Case differences
  14430.                     are ignored when matching labels.
  14431.  
  14432.                     This batch file fragment checks for the existence of
  14433.                     the file CONFIG.SYS.  If the file exists, the batch
  14434.                     file jumps to C_EXISTS and copies all the files from
  14435.                     the current directory to the root directory on A:.
  14436.                     Otherwise, it prints an error message and exits.
  14437.  
  14438.                          if exist config.sys goto C_EXISTS
  14439.                          echo CONFIG.SYS doesn't exist - exiting.
  14440.                          quit
  14441.                          :C_EXISTS
  14442.                          copy *.* a:\
  14443.  
  14444.                     If the label doesn't exist, the batch file is
  14445.                     terminated with the error message "Label not found."
  14446.  
  14447.                ! ## To avoid errors in the processing of nested statements
  14448.                     and loops, GOTO cancels all active IFF statements and
  14449.                     DO /ENDDO loops unless you use /I.  This means that a
  14450.                     normal GOTO (without /I) may not branch to any label
  14451.                     that is between an IFF and the corresponding ENDIFF or
  14452.                     between a DO and the corresponding ENDDO.
  14453.  
  14454.         Options: ## /I(FF and DO continue):  Prevents GOTO from canceling
  14455.                     IFF statements and DO loops.  Use this option only if
  14456.                     you are absolutely certain that your GOTO command is
  14457.                     branching entirely within any current IFF statement
  14458.                     and any active DO / ENDDO block.  Using /I under any
  14459.  
  14460.         -------------------------------------------------------------------
  14461.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 246
  14462.                                                                        GOTO
  14463.         -------------------------------------------------------------------
  14464.  
  14465.  
  14466.                     other conditions will cause an error later in your
  14467.                     batch file.
  14468.  
  14469.                     You cannot branch into another IFF statement, another
  14470.                     DO loop, or a different IFF or DO nesting level,
  14471.                     whether you use the /I option or not.  If you do, you
  14472.                     will eventually receive an "unknown command" error (or
  14473.                     execution of the UNKNOWN_CMD alias) on a subsequent
  14474.                     ENDDO, ELSE, ELSEIFF, or ENDIFF statement.
  14475.  
  14476.  
  14477.  
  14478.  
  14479.  
  14480.  
  14481.  
  14482.  
  14483.  
  14484.  
  14485.  
  14486.  
  14487.  
  14488.  
  14489.  
  14490.  
  14491.  
  14492.  
  14493.  
  14494.  
  14495.  
  14496.  
  14497.  
  14498.  
  14499.  
  14500.  
  14501.  
  14502.  
  14503.  
  14504.  
  14505.  
  14506.  
  14507.  
  14508.  
  14509.  
  14510.  
  14511.  
  14512.  
  14513.  
  14514.  
  14515.  
  14516.  
  14517.         -------------------------------------------------------------------
  14518.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 247
  14519.                                                                        HELP
  14520.         -------------------------------------------------------------------
  14521.  
  14522.  
  14523.         HELP                                   (Enhanced, External command)
  14524.  
  14525.         Purpose:    Display help for internal commands.  Help for external
  14526.                     commands is also available under DOS, and optionally
  14527.                     under OS/2.
  14528.  
  14529.         Format:     HELP [topic]
  14530.  
  14531.                     topic:  A help topic, internal command, or external
  14532.                     command.
  14533.  
  14534.         Usage:      Online help is available for 4DOS, 4OS2, and 4DOS/NT.
  14535.                     The 4OS2 and 4DOS/NT help systems use the operating
  14536.                     system's help facility.  4DOS uses its own help
  14537.                     program.
  14538.  
  14539.                     See page 48 for more details on getting help at the
  14540.                     command line.  See the Introduction and Installation
  14541.                     Guide that was supplied with your version of 4DOS,
  14542.                     4OS2, or 4DOS/NT for a more thorough explanation of
  14543.                     the online help available with the program you use.
  14544.  
  14545.                     If you type the command HELP by itself (or press F1
  14546.                     when the command line is empty), the table of contents
  14547.                     is displayed.  If you type HELP plus a topic name,
  14548.                     that topic is displayed.  For example,
  14549.  
  14550.                          help copy
  14551.  
  14552.                     displays information about the COPY command and its
  14553.                     options.
  14554.  
  14555.  
  14556.  
  14557.  
  14558.  
  14559.  
  14560.  
  14561.  
  14562.  
  14563.  
  14564.  
  14565.  
  14566.  
  14567.  
  14568.  
  14569.  
  14570.  
  14571.  
  14572.  
  14573.  
  14574.         -------------------------------------------------------------------
  14575.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 248
  14576.                                                                     HISTORY
  14577.         -------------------------------------------------------------------
  14578.  
  14579.  
  14580.         HISTORY                                                       (New)
  14581.  
  14582.         Purpose:    Display, add to, clear, or read the history list.
  14583.  
  14584.         Format:     HISTORY [/A command /F /P /R filename]
  14585.  
  14586.                     /A(dd)                   /P(ause)
  14587.                     /F(ree)                  /R(ead)
  14588.  
  14589.                     See also:  LOG.
  14590.  
  14591.         Usage:      4DOS, 4OS2, and 4DOS/NT keep a list of the commands
  14592.                     you have entered on the command line.  See page 36 for
  14593.                     information on command recall, which allows you to use
  14594.                     the history list to repeat or edit commands you have
  14595.                     typed.
  14596.  
  14597.                     The HISTORY command lets you view and manipulate the
  14598.                     command history list directly.  If no parameters are
  14599.                     entered, HISTORY will display the current command
  14600.                     history list:
  14601.  
  14602.                          c:\> history
  14603.  
  14604.                     With the options explained below, you can clear the
  14605.                     list, add new commands to the list without executing
  14606.                     them, save the list in a file, or read a new list from
  14607.                     a file.
  14608.  
  14609.                     The number of commands saved in the history list
  14610.                     depends on the length of each command line.  The
  14611.                     history list size can be specified at startup from 256
  14612.                     to 8192 characters (see page 133).  The default size
  14613.                     is 1024 characters.
  14614.  
  14615.                     Your history list can be stored either locally (a
  14616.                     separate history list for each copy of the command
  14617.                     processor) or globally (all copies of the command
  14618.                     processor share the same list).  For full details see
  14619.                     the discussion of local and global history lists
  14620.                     beginning on page 39.
  14621.  
  14622.                ##   You can use the HISTORY command as an aid in writing
  14623.                     batch files by redirecting the HISTORY output to a
  14624.                     file and then editing the file appropriately.
  14625.                     However, it is easier to use the LOG /H command for
  14626.                     this purpose.
  14627.  
  14628.  
  14629.  
  14630.  
  14631.         -------------------------------------------------------------------
  14632.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 249
  14633.                                                                     HISTORY
  14634.         -------------------------------------------------------------------
  14635.  
  14636.  
  14637.                ##   You can disable the history list or specify a minimum
  14638.                     command-line length to save with the HistMin directive
  14639.                     in the .INI file.
  14640.  
  14641.         Options: ## /A(dd):  Add a command to the history list.  This
  14642.                     performs the same function as the Ctrl-K key at the
  14643.                     command line (see page 36).
  14644.  
  14645.                     /F(ree):  Erase all entries in the command history
  14646.                     list.
  14647.  
  14648.                     /P(rompt):  Wait for a key after displaying each page
  14649.                     of the list.  Your options at the prompt are explained
  14650.                     in detail on page 50.
  14651.  
  14652.                ##   /R(ead):  Read the command history from the specified
  14653.                     file and append it to the history list currently held
  14654.                     in memory.  Each line in the file must fit within the
  14655.                     command-line length limit for your command processor
  14656.                     (see page 50).
  14657.  
  14658.                     You can save the history list by redirecting the
  14659.                     output of HISTORY to a file.  This example saves the
  14660.                     command history to a file called HISTFILE and reads it
  14661.                     back again immediately.  If you leave out the HISTORY
  14662.                     /F command on the second line, the contents of the
  14663.                     file will be appended to the current history list
  14664.                     instead of replacing it:
  14665.  
  14666.                          c:\> history > histfile
  14667.                          c:\> history /f
  14668.                          c:\> history /r histfile
  14669.  
  14670.                     If you need to save your history at the end of each
  14671.                     day's work, you might use commands like this in your
  14672.                     AUTOEXEC.BAT or other startup file:
  14673.  
  14674.                          if exist c:\histfile history /r c:\histfile
  14675.                          alias shut*down `history > c:\histfile`
  14676.  
  14677.                     This restores the previous history list if it exists,
  14678.                     then defines an alias which will save the history
  14679.                     before shutting off the system.
  14680.  
  14681.                ##   If you are creating a HISTORY /R file by hand, and
  14682.                     need to create an entry that spans multiple lines in
  14683.                     the file, you can do so by terminating each line,
  14684.                     except the last, with an escape character (see page
  14685.                     73).  However, you cannot use this method to exceed
  14686.                     the command-line length limit.
  14687.  
  14688.         -------------------------------------------------------------------
  14689.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 250
  14690.                                                                          IF
  14691.         -------------------------------------------------------------------
  14692.  
  14693.  
  14694.         IF                                                       (Enhanced)
  14695.  
  14696.         Purpose:    Execute a command if a condition or set of conditions
  14697.                     is true.
  14698.  
  14699.         Format:     IF [NOT] condition [.AND. | .OR. | .XOR. [NOT]
  14700.                          condition ...] command
  14701.  
  14702.                     condition:  A test to determine if the command should
  14703.                     be executed.
  14704.                     command:  The command to execute if the condition is
  14705.                     true.
  14706.  
  14707.                     See also:  IFF; @IF on page 116.
  14708.  
  14709.         Usage:      IF is normally used only in aliases and batch files.
  14710.                     It is always followed by one or more conditions and
  14711.                     then a command.  First, the conditions are evaluated.
  14712.                     If they are true, the command is executed.  Otherwise,
  14713.                     the command is ignored.  If you add a NOT before a
  14714.                     condition, the command is executed only when the
  14715.                     condition is false.
  14716.  
  14717.                     You can link conditions with .AND., .OR., or .XOR.,
  14718.                     and you can nest IF statements.  The conditions can
  14719.                     test strings, numbers, the existence of a file or
  14720.                     subdirectory, the exit code returned by the preceding
  14721.                     external command, and the existence of alias names and
  14722.                     internal commands.
  14723.  
  14724.                     The command can be an alias, an internal command, an
  14725.                     external command, or a batch file.  The entire IF
  14726.                     statement, including all conditions and the command,
  14727.                     must fit on one line.
  14728.  
  14729.                ##   You can use command grouping (see page 71) to execute
  14730.                     multiple commands if the condition is true.  For
  14731.                     example, the following command tests if any .TXT files
  14732.                     exist.  If they do, they are copied to drive A: and
  14733.                     their extensions are changed to .TXO:
  14734.  
  14735.                          if exist *.txt (copy *.txt a: ^ ren *.txt *.txo)
  14736.  
  14737.                     (Change the command separator to an ampersand [&] to
  14738.                     use a command like this under 4OS2 or 4DOS/NT.  Also,
  14739.                     note that the IFF command provides a more structured
  14740.                     method of executing multiple commands if a condition
  14741.                     or set of conditions is true.)
  14742.  
  14743.  
  14744.  
  14745.         -------------------------------------------------------------------
  14746.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 251
  14747.                                                                          IF
  14748.         -------------------------------------------------------------------
  14749.  
  14750.  
  14751.         4DOS  ! ##  If you receive a stack overflow error when using IF
  14752.                     in complex, nested command sequences, see the notes
  14753.                     under the StackSize directive on page 150.
  14754.  
  14755.         Conditions: The following conditional tests are available in both
  14756.                     the IF and IFF commands.  They fit into two
  14757.                     categories:  string and numeric tests, and status
  14758.                     tests.  The tests can use environment variables,
  14759.                     internal variables and variable functions, file names,
  14760.                     literal text, and numeric values as their arguments.
  14761.  
  14762.                     Spaces are required on either side of the test
  14763.                     condition in all cases, except == which will work with
  14764.                     or without spaces around it.
  14765.  
  14766.  
  14767.                     String and Numeric Tests
  14768.  
  14769.                     Six test conditions can be used to test character
  14770.                     strings.  The same conditions are available for both
  14771.                     numeric and normal text strings (see below for
  14772.                     details).  In each case you enter the test as:
  14773.  
  14774.                          string1 operator string2
  14775.  
  14776.                     The operator defines the type of test (equal, greater
  14777.                     than or equal, and so on).  The operators are:
  14778.  
  14779.                          Operator     Tests
  14780.                          --------     ----------------------------------
  14781.  
  14782.                          EQ or ==     string1 equal to string2
  14783.                          NE or !=     string1 not equal to string2
  14784.                          LT           string1 less than string2
  14785.                          LE           string1 less than or equal to string2
  14786.                          GE           string1 greater than or equal to
  14787.                                       string2
  14788.                          GT           string1 greater than string2
  14789.  
  14790.                     When IF compares two character strings, it will use
  14791.                     either a numeric comparison or a string comparison.  A
  14792.                     numeric comparison treats the strings as numeric
  14793.                     values and tests them arithmetically.  A string
  14794.                     comparison treats the strings as text.
  14795.  
  14796.                     The difference between numeric and string comparisons
  14797.                     is best explained by looking at the way two values are
  14798.                     tested.  For example, consider comparing the values 2
  14799.                     and 19.  Numerically, 2 is smaller, but as a string it
  14800.                     is "larger" because its first digit is larger than the
  14801.  
  14802.         -------------------------------------------------------------------
  14803.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 252
  14804.                                                                          IF
  14805.         -------------------------------------------------------------------
  14806.  
  14807.  
  14808.                     first digit of 19.  So the first of these conditions
  14809.                     will be true, and the second will be false:
  14810.  
  14811.                          if 2 lt 19 ...
  14812.                          if "2" lt "19" ...
  14813.  
  14814.                     IF determines which kind of test to do by examining
  14815.                     the first character of each string.  If both strings
  14816.                     begin with a numeric character (a digit, sign, or
  14817.                     decimal point), a numeric comparison is used.  If
  14818.                     either value does not begin with a numeric character,
  14819.                     a string comparison is used.  To force a string
  14820.                     comparison when both values are or may be numeric, use
  14821.                     double quotes around the values you are testing, as
  14822.                     shown above.  Because the double quote is not a
  14823.                     numeric character, it forces IF to do a string
  14824.                     comparison.
  14825.  
  14826.                     Case differences are ignored in string comparisons.
  14827.                     If two strings begin with the same text but one is
  14828.                     shorter, the shorter string is considered to be "less
  14829.                     than" the longer one.  For example, "a" is less than
  14830.                     "abc", and "hello_there" is greater than "hello".
  14831.  
  14832.                     When you compare text strings, you should always
  14833.                     enclose the arguments in double quotes in order to
  14834.                     avoid syntax errors which may occur if one of the
  14835.                     argument values is empty.
  14836.  
  14837.                     Numeric comparisons work with both integer and decimal
  14838.                     values.  The values to be compared must contain only
  14839.                     numeric digits, decimal points, and an optional sign
  14840.                     (+ or -).  The number to the left of the decimal point
  14841.                     may not exceed 2,147,483,648 (the maximum possible 32-
  14842.                     bit positive integer).  The number of digits to the
  14843.                     right of the decimal point is limited only by the
  14844.                     length of the command line.
  14845.  
  14846.                     Internal variables (page 100) and variable functions
  14847.                     (page 108) are very powerful when combined with string
  14848.                     and numeric comparisons.  They allow you to test the
  14849.                     state of your system, the characteristics of a file,
  14850.                     date and time information, or the result of a
  14851.                     calculation.  You may want to review the variables and
  14852.                     variable functions when determining the best way to
  14853.                     set up an IF test.
  14854.  
  14855.                     This first example is a batch file fragment which runs
  14856.                     a program called MONOPROG if a monochrome monitor is
  14857.                     attached to the system (this example will work in 4DOS
  14858.  
  14859.         -------------------------------------------------------------------
  14860.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 253
  14861.                                                                          IF
  14862.         -------------------------------------------------------------------
  14863.  
  14864.  
  14865.                     or 4OS2; 4DOS/NT does not include the _MONITOR
  14866.                     variable):
  14867.  
  14868.                          if "%_monitor" == "mono" monoprog
  14869.  
  14870.                     The second batch file fragment tests for a string
  14871.                     value:
  14872.  
  14873.                          input "Enter your selection : " %%cmd
  14874.                          if "%cmd" == "WP" goto wordproc
  14875.                          if "%cmd" NE "GRAPHICS" goto badentry
  14876.  
  14877.                     This example calls GO.BTM if the first two characters
  14878.                     in the file MYFILE are "GO" (enter this example on one
  14879.                     line):
  14880.  
  14881.                          if "%@instr[0,2,%@line[myfile,0]]"=="GO"
  14882.                          call go.btm
  14883.  
  14884.                     The next two examples test whether there is more than
  14885.                     500 KBytes of free memory or more than 2 MBytes of
  14886.                     free EMS memory (the EMS example only applies to
  14887.                     4DOS):
  14888.  
  14889.                          c:\> if %@dosmem[k] gt 500 echo Over 500K free
  14890.                          c:\> if %@ems[m] gt 2 echo Over 2 MB EMS free
  14891.  
  14892.  
  14893.                     Status Tests
  14894.  
  14895.                     These conditions test the system or command processor
  14896.                     status.  You can use internal variables and variable
  14897.                     functions to test many other parts of the system
  14898.                     status.
  14899.  
  14900.                        ERRORLEVEL [operator] n
  14901.  
  14902.                          This test retrieves the exit code of the
  14903.                          preceding external program.  By convention,
  14904.                          programs return an exit code of 0 when they are
  14905.                          successful and a number between 1 and 255 to
  14906.                          indicate an error.  The condition can be any of
  14907.                          the operators listed above (EQ, !=, GT, etc.).
  14908.                          If no operator is specified, the default is GE.
  14909.                          The comparison is done numerically.
  14910.  
  14911.                          Not all programs return an explicit exit code.
  14912.                          For programs which do not, the behavior of
  14913.                          ERRORLEVEL is undefined.
  14914.  
  14915.  
  14916.         -------------------------------------------------------------------
  14917.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 254
  14918.                                                                          IF
  14919.         -------------------------------------------------------------------
  14920.  
  14921.  
  14922.                        EXIST filename
  14923.  
  14924.                          If the file exists, the condition is true.  You
  14925.                          can use wildcards in the filename, in which case
  14926.                          the condition is true if any file matching the
  14927.                          wildcard name exists.
  14928.  
  14929.                        ISALIAS aliasname
  14930.  
  14931.                          If the name is defined as an alias, the condition
  14932.                          is true.
  14933.  
  14934.                        ISDIR | DIREXIST path
  14935.  
  14936.                          If the subdirectory exists, the condition is
  14937.                          true.  For compatibility with DR DOS and Novell
  14938.                          DOS, DIREXIST may be used as a synonym for ISDIR.
  14939.  
  14940.                        ISINTERNAL command
  14941.  
  14942.                          If the specified command is an active internal
  14943.                          command, the condition is true.  Commands can be
  14944.                          activated and deactivated with the SETDOS /I
  14945.                          command.
  14946.  
  14947.             4NT        ISWINDOW "title"
  14948.  
  14949.                          If a window with the title exists, the condition
  14950.                          is true.  Double quotes must be used around the
  14951.                          title.
  14952.  
  14953.                     The first batch file fragment below tests for the
  14954.                     existence of A:\JAN.DOC before copying it to drive C.
  14955.  
  14956.                          if exist a:\jan.doc copy a:\jan.doc c:\
  14957.  
  14958.                     This example tests the exit code of the previous
  14959.                     program and stops all batch file processing if an
  14960.                     error occurred:
  14961.  
  14962.                          if errorlevel==0 goto success
  14963.                          echo "External Error -- Batch File Ends!"
  14964.                          cancel
  14965.  
  14966.  
  14967.                  ## Combining Tests
  14968.  
  14969.                     You can negate the result of any test with NOT, and
  14970.                     combine tests of any type with .AND., .OR., and .XOR.
  14971.                     Test conditions are always scanned from left to right
  14972.  
  14973.         -------------------------------------------------------------------
  14974.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 255
  14975.                                                                          IF
  14976.         -------------------------------------------------------------------
  14977.  
  14978.  
  14979.                     - there is no implied order of precedence, as there is
  14980.                     in some programming languages.
  14981.  
  14982.                     When two tests are combined with .AND., the result is
  14983.                     true if both individual tests are true.  When two
  14984.                     tests are combined with .OR., the result is true if
  14985.                     either (or both) individual tests are true.  When two
  14986.                     tests are combined with .XOR., the result is true only
  14987.                     if one of the tests is true and the other is false.
  14988.  
  14989.                     This example runs a program called HIGHRES if either
  14990.                     an EGA or VGA video adapter is in use (this will work
  14991.                     in 4DOS or 4OS2; 4DOS/NT does not include the _VIDEO
  14992.                     variable):
  14993.  
  14994.                          if "%_video"=="EGA" .or. "%_video"==vga highres
  14995.  
  14996.  
  14997.  
  14998.  
  14999.  
  15000.  
  15001.  
  15002.  
  15003.  
  15004.  
  15005.  
  15006.  
  15007.  
  15008.  
  15009.  
  15010.  
  15011.  
  15012.  
  15013.  
  15014.  
  15015.  
  15016.  
  15017.  
  15018.  
  15019.  
  15020.  
  15021.  
  15022.  
  15023.  
  15024.  
  15025.  
  15026.  
  15027.  
  15028.  
  15029.  
  15030.         -------------------------------------------------------------------
  15031.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 256
  15032.                                                                         IFF
  15033.         -------------------------------------------------------------------
  15034.  
  15035.  
  15036.         IFF                                                           (New)
  15037.  
  15038.         Purpose:    Perform IF / THEN / ELSE conditional execution of
  15039.                     commands.
  15040.  
  15041.         Format:     IFF [NOT] condition [.AND. | .OR. | .XOR. [NOT]
  15042.                        condition ...] THEN ^ commands
  15043.                     [ELSEIFF condition  THEN ^ commands] ...
  15044.                     [ELSE ^ commands]
  15045.                     ^ ENDIFF
  15046.  
  15047.                     condition:  A test to determine if the command(s)
  15048.                     should be executed.
  15049.                     commands:  One or more commands to execute if the
  15050.                     condition(s) is true.  If you use multiple commands,
  15051.                     they must be separated by command separators or be
  15052.                     placed on separate lines of a batch file.
  15053.  
  15054.                     See also:  IF.
  15055.  
  15056.         Usage:      IFF is similar to the IF command, except that it can
  15057.                     perform one set of commands when a condition or set of
  15058.                     conditions is true and different commands when the
  15059.                     conditions are false.
  15060.  
  15061.                     IFF can execute multiple commands when the conditions
  15062.                     are true or false; IF normally executes only one
  15063.                     command.  IFF imposes no limit on the number of
  15064.                     commands and is generally a "cleaner" and more
  15065.                     structured command than IF.
  15066.  
  15067.                     IFF is always followed by one or more conditions.  If
  15068.                     they are true, the commands that follow the word THEN
  15069.                     are executed.  Additional conditions can be tested
  15070.                     with ELSEIFF.  If none of these conditions are true,
  15071.                     the commands that follow the word ELSE are executed.
  15072.                     In both cases, after the selected commands are
  15073.                     executed, processing continues after the word ENDIFF.
  15074.  
  15075.                     If you add a NOT before the condition, the THEN
  15076.                     commands are executed only when the condition is false
  15077.                     and the ELSE commands are executed only when the
  15078.                     condition is true.
  15079.  
  15080.                     The commands may be separated by command separators,
  15081.                     or may be on separate lines of a batch file.  You
  15082.                     should include a command separator or a line break
  15083.                     after a THEN, before an ELSEIFF, and before and after
  15084.                     an ELSE.  Note that the syntax above and the examples
  15085.                     below use the default 4DOS command separator, a caret
  15086.  
  15087.         -------------------------------------------------------------------
  15088.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 257
  15089.                                                                         IFF
  15090.         -------------------------------------------------------------------
  15091.  
  15092.  
  15093.                     [^].  Replace the caret with an ampersand [&] if you
  15094.                     are using 4OS2 or 4DOS/NT.
  15095.  
  15096.                     You can link conditions with .AND., .OR., or .XOR.,
  15097.                     and you can nest IFF statements up to 15 levels deep.
  15098.                     The conditions can test strings or numbers, the
  15099.                     existence of a file or subdirectory, the errorlevel
  15100.                     returned from the preceding external command, and the
  15101.                     existence of alias names and internal commands.
  15102.  
  15103.                     See the IF command for a list of the possible
  15104.                     conditions.
  15105.  
  15106.                     The commands can include any internal command, alias,
  15107.                     external command, or batch file.
  15108.  
  15109.                     The following batch file fragment for 4DOS or 4OS2
  15110.                     tests the monitor type (monochrome or color), and sets
  15111.                     the appropriate colors and prompt (enter the "prompt"
  15112.                     lines on one line of the batch file):
  15113.  
  15114.                          iff "%_monitor" == "color" then
  15115.                            color bright white on blue ^ cls
  15116.                            prompt=$e[s$e[1;1f$e[41;1;37m$e[K  Path:
  15117.                               $p$e[u$e[44;37m$n$g
  15118.                          else
  15119.                            prompt=$e[s$e[1;1f$e[0;7m$e[K  Path:
  15120.                               $p$e[u$e[0m$n$g
  15121.                          endiff
  15122.  
  15123.                     (The above example uses ANSI color sequences in the
  15124.                     prompt, which work in 4DOS if an ANSI driver is
  15125.                     loaded, and in 4OS2.  They will not work in 4DOS/NT,
  15126.                     because Windows NT does not offer ANSI support.  See
  15127.                     PROMPT for additional details.)
  15128.  
  15129.                     The alias in this second example checks to see if the
  15130.                     argument is a subdirectory.  If so, the alias deletes
  15131.                     the subdirectory's files and removes it (enter this on
  15132.                     one line):
  15133.  
  15134.                          c:\> alias prune `iff isdir %1 then ^
  15135.                               del /sxz %1 ^ else ^
  15136.                               echo Not a directory!^endiff`
  15137.  
  15138.                ! ## Be sure to read the cautionary notes about GOTO and
  15139.                     IFF under the GOTO command (page 246) before using a
  15140.                     GOTO inside an IFF statement.
  15141.  
  15142.  
  15143.  
  15144.         -------------------------------------------------------------------
  15145.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 258
  15146.                                                                       INKEY
  15147.         -------------------------------------------------------------------
  15148.  
  15149.  
  15150.         INKEY                                                         (New)
  15151.  
  15152.         Purpose:    Get a single keystroke from the user and store it in
  15153.                     an environment variable.
  15154.  
  15155.         Format:     INKEY [/C /D /K"keys" /P /Wn /X] [prompt] %%varname
  15156.  
  15157.                     prompt:  Optional text that is displayed as a prompt.
  15158.                     varname:  The variable that will hold the user's
  15159.                     keystroke.
  15160.  
  15161.                     /C(lear buffer)          /P(assword)
  15162.                     /D(igits only)           /W(ait)
  15163.                     /K (valid keystrokes)    /X (no carriage return)
  15164.  
  15165.                     See also:  INPUT and KEYSTACK.
  15166.  
  15167.         Usage:      INKEY optionally displays a prompt.  Then it waits for
  15168.                     a specified time or indefinitely for a keystroke, and
  15169.                     places the keystroke into an environment variable.  It
  15170.                     is normally used in batch files and aliases to get a
  15171.                     menu choice or other single-key input.  Along with the
  15172.                     INPUT command, INKEY allows great flexibility in
  15173.                     reading input from within a batch file or alias.
  15174.  
  15175.                     If prompt text is included in an INKEY command, it is
  15176.                     displayed while INKEY waits for input.
  15177.  
  15178.                     The following batch file fragment prompts for a
  15179.                     character and stores it in the variable NUM:
  15180.  
  15181.                          inkey Enter a number from 1 to 9:  %%num
  15182.  
  15183.                     INKEY reads standard input for the keystroke, so it
  15184.                     will accept keystrokes from a redirected file or from
  15185.                     the Keystack under 4DOS.  You can supply a list of
  15186.                     valid keystrokes with the /K option.
  15187.  
  15188.                     Standard keystrokes with ASCII values between 1 and
  15189.                     255 are stored directly in the environment variable.
  15190.                     Extended keystrokes (for example, function keys and
  15191.                     cursor keys) are stored as a string in decimal format,
  15192.                     with a leading @ (for example, the F1 key is @59).
  15193.                     The Enter key is stored as an extended keystroke, with
  15194.                     the code @28.  See Appendix B (page 371) for a list of
  15195.                     the ASCII and extended key codes.
  15196.  
  15197.                     If you press Ctrl-C or Ctrl-Break while INKEY is
  15198.                     waiting for a key, execution of an alias will be
  15199.                     terminated, and execution of a batch file will be
  15200.  
  15201.         -------------------------------------------------------------------
  15202.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 259
  15203.                                                                       INKEY
  15204.         -------------------------------------------------------------------
  15205.  
  15206.  
  15207.                     suspended while you are asked whether to cancel the
  15208.                     batch job (see page 85).  In a batch file you can
  15209.                     handle Ctrl-C and Ctrl-Break yourself with the ON
  15210.                     BREAK command (see page 288).
  15211.  
  15212.         Options:    /C(lear buffer):  Clears the keyboard buffer before
  15213.                     INKEY accepts keystrokes.  If you use this option,
  15214.                     INKEY will ignore any keystrokes which you type,
  15215.                     either accidentally or intentionally, before INKEY is
  15216.                     ready to accept input.
  15217.  
  15218.                     /D(igits only):  Prevents INKEY from accepting any
  15219.                     keystroke except a digit from 0 to 9.
  15220.  
  15221.                     /K["keys"]:  Specify the permissible keystrokes.  The
  15222.                     list of valid keystrokes should be enclosed in double
  15223.                     quotes.  For alphabetic keys the validity test is not
  15224.                     case-sensitive.  You can specify extended keys by
  15225.                     enclosing their names in square brackets (within the
  15226.                     quotes), for example:
  15227.  
  15228.                          inkey /k"ab[Alt-F10]" Enter A, B, or Alt-F10
  15229.                          %%var
  15230.  
  15231.                     See page 31 for a complete listing of the key names
  15232.                     you can use within the square brackets, and a
  15233.                     description of the key name format.
  15234.  
  15235.                     If an invalid keystroke is entered, the command
  15236.                     processor will echo the keystroke if possible, beep,
  15237.                     move the cursor back one character, and wait for
  15238.                     another keystroke.
  15239.  
  15240.                     /P(assword):  Prevents INKEY from echoing the
  15241.                     character.
  15242.  
  15243.                     /W(ait):  Timeout period, in seconds, to wait for a
  15244.                     response.  If no keystroke is entered by the end of
  15245.                     the timeout period, INKEY returns with the variable
  15246.                     unchanged.  You can specify /W0 to return immediately
  15247.                     if there are no keys waiting in the keyboard buffer.
  15248.  
  15249.                     For example, the following batch file fragment waits
  15250.                     up to 10 seconds for a character, then tests to see if
  15251.                     a "Y" was entered:
  15252.  
  15253.                          set net=N
  15254.                          inkey /K"YN" /w10 Load the network (Y/N)?  %%net
  15255.                          iff "%net" == "Y" then
  15256.                            rem Commands to load the network go here
  15257.  
  15258.         -------------------------------------------------------------------
  15259.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 260
  15260.                                                                       INKEY
  15261.         -------------------------------------------------------------------
  15262.  
  15263.  
  15264.                          endiff
  15265.  
  15266.                     /X (no carriage return):  Prevents INKEY from
  15267.                     displaying a carriage return and line feed after the
  15268.                     user's entry.
  15269.  
  15270.  
  15271.  
  15272.  
  15273.  
  15274.  
  15275.  
  15276.  
  15277.  
  15278.  
  15279.  
  15280.  
  15281.  
  15282.  
  15283.  
  15284.  
  15285.  
  15286.  
  15287.  
  15288.  
  15289.  
  15290.  
  15291.  
  15292.  
  15293.  
  15294.  
  15295.  
  15296.  
  15297.  
  15298.  
  15299.  
  15300.  
  15301.  
  15302.  
  15303.  
  15304.  
  15305.  
  15306.  
  15307.  
  15308.  
  15309.  
  15310.  
  15311.  
  15312.  
  15313.  
  15314.  
  15315.         -------------------------------------------------------------------
  15316.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 261
  15317.                                                                       INPUT
  15318.         -------------------------------------------------------------------
  15319.  
  15320.  
  15321.         INPUT                                                         (New)
  15322.  
  15323.         Purpose:    Get a string from the keyboard and save it in an
  15324.                     environment variable.
  15325.  
  15326.         Format:     INPUT [/C /D /E /Ln /N /P /Wn /X] [prompt] %%varname
  15327.  
  15328.                     prompt:  Optional text that is displayed as a prompt.
  15329.                     varname:  The variable that will hold the user's
  15330.                     input.
  15331.  
  15332.                     /C(lear buffer)          /N(o colors)
  15333.                     /D(igits only)           /P(assword)
  15334.                     /E(dit)                  /W(ait)
  15335.                     /L(ength)                /X (no carriage return)
  15336.  
  15337.                     See also:  INKEY and KEYSTACK.
  15338.  
  15339.         Usage:      INPUT optionally displays a prompt.  Then it waits for
  15340.                     a specified time or indefinitely for your entry.  It
  15341.                     places any characters you type into an environment
  15342.                     variable.  INPUT is normally used in batch files and
  15343.                     aliases to get multi-key input.  Along with the INKEY
  15344.                     command, INPUT allows great flexibility in reading
  15345.                     user input from within a batch file or alias.
  15346.  
  15347.                     If prompt text is included in an INPUT command, it is
  15348.                     displayed while INPUT waits for input.  Standard
  15349.                     command-line editing keys may be used to edit the
  15350.                     input string as it is entered.  If you use the /P
  15351.                     password option, INPUT will echo asterisks instead of
  15352.                     the keys you type.
  15353.  
  15354.                     All characters entered up to, but not including, the
  15355.                     carriage return are stored in the variable.
  15356.  
  15357.                     The following batch file fragment prompts for a string
  15358.                     and stores it in the variable FNAME:
  15359.  
  15360.                          input Enter the file name:  %%fname
  15361.  
  15362.                     INPUT reads standard input, so it will accept text
  15363.                     from a re-directed file or from the KEYSTACK.
  15364.  
  15365.                     If you press Ctrl-C or Ctrl-Break while INPUT is
  15366.                     waiting for input, execution of an alias will be
  15367.                     terminated, and execution of a batch file will be
  15368.                     suspended while you are asked whether to cancel the
  15369.                     batch job (see page 85).  In a batch file you can
  15370.  
  15371.  
  15372.         -------------------------------------------------------------------
  15373.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 262
  15374.                                                                       INPUT
  15375.         -------------------------------------------------------------------
  15376.  
  15377.  
  15378.                     handle Ctrl-C and Ctrl-Break yourself with the ON
  15379.                     BREAK command (see page 288).
  15380.  
  15381.         Option:     /C(lear buffer):  Clears the keyboard buffer before
  15382.                     INPUT accepts keystrokes.  If you use this option,
  15383.                     INPUT will ignore any keystrokes which you type,
  15384.                     either accidentally or intentionally, before INPUT is
  15385.                     ready.
  15386.  
  15387.                     /D(igits only):  Prevents INPUT from accepting any
  15388.                     keystrokes except digits from 0 to 9.
  15389.  
  15390.                     /E(dit):  Allows you to edit an existing value.  If
  15391.                     there is no existing value for varname, INPUT proceeds
  15392.                     as if /E had not been used, and allows you to enter a
  15393.                     new value.
  15394.  
  15395.                     /Ln (Length):  Sets the maximum number of characters
  15396.                     which INPUT will accept to "n".  If you attempt to
  15397.                     enter more than this number of characters, INPUT will
  15398.                     beep and prevent further input (you will still be able
  15399.                     to edit the characters typed before the limit was
  15400.                     reached).
  15401.  
  15402.                     /N(o colors):  Disables the use of input colors
  15403.                     defined in the InputColor directive in the .INI file,
  15404.                     and forces INPUT to use the default display colors.
  15405.  
  15406.                     /P(assword):  Tells INPUT to echo asterisks, instead
  15407.                     of the characters you type.
  15408.  
  15409.                     /W(ait):  Timeout period, in seconds, to wait for a
  15410.                     response.  If no keystroke is entered by the end of
  15411.                     the timeout period, INPUT returns with the variable
  15412.                     unchanged.  If you enter a key before the timeout
  15413.                     period, INPUT will wait indefinitely for the remainder
  15414.                     of the line.  You can specify /W0 to return
  15415.                     immediately if there are no keys waiting in the
  15416.                     keyboard buffer.
  15417.  
  15418.                     /X (no carriage return):  Prevents INPUT from
  15419.                     displaying a carriage return and line feed after the
  15420.                     user's entry.
  15421.  
  15422.  
  15423.  
  15424.  
  15425.  
  15426.  
  15427.  
  15428.  
  15429.         -------------------------------------------------------------------
  15430.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 263
  15431.                                                                       KEYBD
  15432.         -------------------------------------------------------------------
  15433.  
  15434.  
  15435.         KEYBD                                                         (New)
  15436.  
  15437.         Purpose:    Set the state of the keyboard toggles:  Caps Lock, Num
  15438.                     Lock, and Scroll Lock.
  15439.  
  15440.         Format:     KEYBD [/Cn /Nn /Sn]
  15441.  
  15442.                     /C(aps lock)                /S(croll lock)
  15443.                     /N(um lock)
  15444.  
  15445.                     n can be 0 to turn off the toggle, or 1 to turn it on.
  15446.  
  15447.         Usage:      Most keyboards have 3 toggle keys, the Caps Lock, Num
  15448.                     Lock, and Scroll Lock.  The toggle key status is
  15449.                     usually displayed by three lights at the top right
  15450.                     corner of the keyboard.
  15451.  
  15452.                     This command lets you turn any toggle key on or off.
  15453.                     It is most useful in batch files and aliases if you
  15454.                     want the keys set a particular way before collecting
  15455.                     input from the user.
  15456.  
  15457.                     For example, to turn off the Num Lock and Caps Lock
  15458.                     keys, you can use this command:
  15459.  
  15460.                          c:\> keybd /c0 /n0
  15461.  
  15462.                     If you use the KEYBD command with no switches, it will
  15463.                     display the present state of the toggle keys.
  15464.  
  15465.            4DOS ##  In 4DOS, KEYBD works by performing a BIOS setting.
  15466.                     Some memory resident programs that monitor the
  15467.                     physical keyboard rather than BIOS settings may not
  15468.                     recognize that the state of the toggle keys has
  15469.                     changed after a KEYBD command.
  15470.  
  15471.            4OS2 ##  In OS/2, the toggle key state is different for each
  15472.                     session.  Changes made with KEYBD will affect the
  15473.                     session in which the command is executed, but will not
  15474.                     affect other sessions.
  15475.  
  15476.             4NT  ## In Windows NT, the toggle key state is the same for
  15477.                     all sessions.  Changes made in one session will affect
  15478.                     all other sessions.
  15479.  
  15480.         Options:    /C(aps lock):  Turn the Caps Lock key on or off.
  15481.  
  15482.                     /N(um lock):  Turn the Num Lock key on or off.
  15483.  
  15484.                     /S(croll lock):  Turn the Scroll Lock key on or off.
  15485.  
  15486.         -------------------------------------------------------------------
  15487.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 264
  15488.                                                    [4OS2, 4DOS/NT]     KEYS
  15489.         -------------------------------------------------------------------
  15490.  
  15491.  
  15492.         KEYS      [4OS2, 4DOS/NT]                                (Enhanced)
  15493.  
  15494.         Purpose:    Enable, disable, or display the history list.
  15495.  
  15496.         Format:     KEYS [ON | OFF | LIST]
  15497.  
  15498.                     See also:  HISTORY.
  15499.  
  15500.         Usage:      This command is provided for compatibility with KEYS
  15501.                     command in CMD.EXE, which controls the history list in
  15502.                     OS/2 and Windows NT.  The same functions are available
  15503.                     by setting the HistMin directive in the .INI file, and
  15504.                     by using the HISTORY command.
  15505.  
  15506.                     The history list collects the commands you type for
  15507.                     later recall, editing, and viewing.  You can view the
  15508.                     contents of the list through the history list window
  15509.                     or by typing any of the following commands:
  15510.  
  15511.                          [c:\] history
  15512.                          [c:\] history /p
  15513.                          [c:\] keys list
  15514.  
  15515.                     The first command displays the entire history list.
  15516.                     The second displays the entire list and pauses at the
  15517.                     end of each full screen.  The third command produces
  15518.                     the same output as the first, except that each line is
  15519.                     numbered.
  15520.  
  15521.                     You can disable the collection and storage of commands
  15522.                     in the history list by typing:
  15523.  
  15524.                          [c:\] keys off
  15525.  
  15526.                     You can turn the history back on with the command:
  15527.  
  15528.                          [c:\] keys on
  15529.  
  15530.                     If you issue the KEYS command without any parameters,
  15531.                     4OS2 or 4DOS/NT will show you the current status of
  15532.                     the history list.
  15533.  
  15534.             4OS2    KEYS also affects the way 4OS2 reads input from the
  15535.                     keyboard.  KEYS OFF will force 4OS2 into line input
  15536.                     mode; KEYS ON will return input to the usual character
  15537.                     by character method.  See the LineInput directive on
  15538.                     page 140, or the /L option of the SETDOS command on
  15539.                     page 325, for details on line input mode.
  15540.  
  15541.  
  15542.  
  15543.         -------------------------------------------------------------------
  15544.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 265
  15545.                                                         [4DOS]     KEYSTACK
  15546.         -------------------------------------------------------------------
  15547.  
  15548.  
  15549.         KEYSTACK      [4DOS]                                          (New)
  15550.  
  15551.         Purpose:    Feed keystrokes to a program or command automatically.
  15552.  
  15553.         Format:     KEYSTACK [/Wn] ["abc"] [keyname] [!] ...
  15554.  
  15555.                     "abc":  Literal characters to be placed in the
  15556.                     Keystack.
  15557.                     keyname:  Name or code for a key to be placed in the
  15558.                     Keystack.
  15559.                     !:  Signal to clear the Keystack and the keyboard
  15560.                     buffer.
  15561.  
  15562.                     /W(ait)
  15563.  
  15564.         Usage:      KEYSTACK takes a series of keystrokes and feeds them
  15565.                     to a program or command as if they were typed at the
  15566.                     keyboard.  When the program has used all of the
  15567.                     keystrokes in the keystack buffer, it will begin to
  15568.                     read the keyboard for input, as it normally would.
  15569.  
  15570.                     The KEYSTACK command must be executed before running
  15571.                     the program which is going to receive the keystrokes.
  15572.                     This places the keystrokes into the buffer first, so
  15573.                     the program can find them when it runs.
  15574.  
  15575.                     KEYSTACK will only work if the memory-resident program
  15576.                     KSTACK.COM has been loaded.  KSTACK is usually loaded
  15577.                     from the AUTOEXEC.BAT file (see page 86).  If KSTACK
  15578.                     is not loaded, the KEYSTACK command will display an
  15579.                     error message.  If you are using a multitasking system
  15580.                     such as DESQview or Windows, see your Introduction and
  15581.                     Installation Guide for information on loading KSTACK
  15582.                     within a window.
  15583.  
  15584.                     Characters entered within double quotes ("abc") will
  15585.                     be stored "as is" in the keyboard buffer.  The only
  15586.                     items allowed outside double quotes are key names, key
  15587.                     codes, and the ! and /W options.
  15588.  
  15589.                     See page 31 for a complete listing of key names and a
  15590.                     description of the key name format.
  15591.  
  15592.                     An exclamation mark [!] will clear all pending
  15593.                     keystrokes, both in the KEYSTACK buffer and in the
  15594.                     keyboard buffer.
  15595.  
  15596.                     For example, to start ProComm Plus and skip the
  15597.                     opening screen you could use the command:
  15598.  
  15599.  
  15600.         -------------------------------------------------------------------
  15601.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 266
  15602.                                                         [4DOS]     KEYSTACK
  15603.         -------------------------------------------------------------------
  15604.  
  15605.  
  15606.                          c:\comm> keystack 32 ^ pcplus
  15607.  
  15608.                     This places a space (ASCII code 32) in the buffer,
  15609.                     then runs ProComm Plus.  When ProComm looks for a
  15610.                     keystroke to end the display of the opening screen the
  15611.                     keystroke is already in the buffer, and the opening
  15612.                     screen is removed immediately.
  15613.  
  15614.                     You can store a maximum of 255 characters in the
  15615.                     KEYSTACK buffer.  Each time the KEYSTACK command is
  15616.                     executed, it will clear any remaining keystrokes
  15617.                     stored by a previous KEYSTACK command.
  15618.  
  15619.                     You may need to experiment with your programs and
  15620.                     insert delays (see the /W option) to find a keystroke
  15621.                     sequence that works for a particular program.
  15622.  
  15623.                     Programs that bypass DOS and the BIOS for keyboard
  15624.                     input cannot read keystrokes entered with KEYSTACK.
  15625.                     If you use KEYSTACK and then run such a program, the
  15626.                     keystrokes will not appear in the program, but may
  15627.                     appear at the prompt when you exit the program and
  15628.                     return to 4DOS.
  15629.  
  15630.                ##   KEYSTACK treats the number 0 as a special case; it is
  15631.                     used with programs that flush the keyboard buffer.
  15632.                     When KEYSTACK processes a key value of 0, it tells the
  15633.                     program the buffer is clear, so subsequent keystrokes
  15634.                     will be accepted normally.  Some programs will require
  15635.                     several "0"s before they will accept input; you may
  15636.                     need to experiment to determine the correct number.
  15637.  
  15638.                     For example, the following batch file starts Lotus 1-
  15639.                     2-3 and loads the file specified on the command line
  15640.                     when the batch file is invoked (the KEYSTACK command
  15641.                     should be entered on one line):
  15642.  
  15643.                          pushd c:\123
  15644.                          keystack 0 Enter 0 Enter 0 Enter 0 Enter 0 Enter
  15645.                            "/FR" 0 "%1" Enter
  15646.                          123
  15647.                          popd
  15648.  
  15649.                     The sequence of "0 Enter" pairs tells 1-2-3 that the
  15650.                     keyboard buffer is empty, then passes 1-2-3 a carriage
  15651.                     return, repeating this sequence five times.  This gets
  15652.                     1-2-3 to a point where an empty spreadsheet is
  15653.                     displayed.  The rest of the KEYSTACK line issues a
  15654.                     File Retrieve command (/FR), simulates an empty
  15655.                     keyboard buffer once more, enters the file name passed
  15656.  
  15657.         -------------------------------------------------------------------
  15658.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 267
  15659.                                                         [4DOS]     KEYSTACK
  15660.         -------------------------------------------------------------------
  15661.  
  15662.  
  15663.                     on the batch command line (%1), and finally enters a
  15664.                     carriage return to end the file name.
  15665.  
  15666.                ##   Here's the same command defined as an alias (enter
  15667.                     this on one line):
  15668.  
  15669.                          alias 321 `pushd c:\123 ^ keystack 0 Enter 0
  15670.                          Enter 0 Enter 0 Enter 0 Enter "/FR" 0 "%1" Enter
  15671.                          ^ 123 ^ popd`
  15672.  
  15673.                ##   KEYSTACK mimics the BIOS by stacking both an ASCII
  15674.                     code and a scan code for each key.  It does so by
  15675.                     calculating the code for each character, whether it is
  15676.                     entered as part of a quoted string, as a key name, or
  15677.                     as an ASCII value less than 128.  However, if you are
  15678.                     stacking keys for a program which distinguishes
  15679.                     between keys with the same symbol, like the plus on
  15680.                     the keyboard and the gray plus, you will have to
  15681.                     calculate the codes for the keys on the numeric keypad
  15682.                     yourself.  Calculate the value ((256 * scan code) +
  15683.                     ASCII code) and enter that numeric value as an
  15684.                     argument for KEYSTACK.  For example, for the Enter key
  15685.                     on the numeric keypad, the scan code is 224 and the
  15686.                     ASCII code is 13, so to stack both values use ((256 *
  15687.                     224) + 13) or KEYSTACK 57357.  Try this approach if a
  15688.                     "normal" KEYSTACK command does not work (for example,
  15689.                     if you use "KEYSTACK Enter" for the Enter key and the
  15690.                     program doesn't see the correct character).  To stack
  15691.                     combined key codes you must use the numeric value, not
  15692.                     the key name.  See Appendix B on page 371 for a
  15693.                     complete list of ASCII codes and scan codes.
  15694.  
  15695.         Options: ## /W(ait):  Delay the next keystroke in the KEYSTACK
  15696.                     buffer by a specified number of clock "ticks".  A
  15697.                     clock tick is approximately 1/18 second.  The number
  15698.                     of clock ticks to delay should be placed immediately
  15699.                     after the W, and must be between 1 and 65535 (65535
  15700.                     ticks is about 1 hour).  You can use the /W option as
  15701.                     many times as desired and at any point in the string
  15702.                     of keystrokes except within double quotes.  Some
  15703.                     programs may need the delays provided by /W in order
  15704.                     to receive keystrokes properly from KEYSTACK.  The
  15705.                     only way to determine what delay is needed is to
  15706.                     experiment.  Sometimes a combination of a delay and an
  15707.                     "empty buffer" signal (a 0) are required.  For
  15708.                     example, to start the program CADX and send it an F7,
  15709.                     a delay of one second, an indication that the keyboard
  15710.                     buffer is empty, and a carriage return:
  15711.  
  15712.                          c:\> keystack F7 /W18 0 Enter ^ cadx
  15713.  
  15714.         -------------------------------------------------------------------
  15715.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 268
  15716.                                                    [4DOS]     LH / LOADHIGH
  15717.         -------------------------------------------------------------------
  15718.  
  15719.  
  15720.         LH / LOADHIGH      [4DOS]                              (Compatible)
  15721.  
  15722.         Purpose:    Load a memory resident program into an Upper Memory
  15723.                     Block (UMB).
  15724.  
  15725.         Format:     LH [/L:r1,n1;r2,n2;... /S] filename
  15726.  
  15727.                          or
  15728.  
  15729.                     LOADHIGH [/L:r1,n1;r2,n2;... /S] filename
  15730.  
  15731.                     filename:  The name of the program to load into high
  15732.                     memory.
  15733.  
  15734.                     /L(oad region)              /S(hrink)
  15735.  
  15736.         Usage:      LH and LOADHIGH are synonyms.  You can use either one.
  15737.  
  15738.                     LOADHIGH requires version 5.0 or later of MS-DOS, PC-
  15739.                     DOS, DR DOS, or Novell DOS, or an OS/2 2.x DOS
  15740.                     session.
  15741.  
  15742.                     If you load memory-resident programs into UMBs, you
  15743.                     will have more room in base memory for application
  15744.                     programs.  If your system has no UMBs, or if the
  15745.                     program is larger than the largest UMB, then LOADHIGH
  15746.                     will load the program into conventional base memory.
  15747.  
  15748.                     For example, to load the program C:\UTIL\CACHE.EXE
  15749.                     into high memory:
  15750.  
  15751.                          c:\> loadhigh c:\util\cache.exe
  15752.  
  15753.                     If you are running MS-DOS / PC-DOS 5.0 or above, or an
  15754.                     OS/2 2.x DOS session, LOADHIGH requires the DOS=UMB
  15755.                     command in your CONFIG.SYS file.  It can only be used
  15756.                     to load programs into UMBs managed by version 5.0 or
  15757.                     later of MS-DOS, PC-DOS, DR DOS, or Novell DOS; or by
  15758.                     OS/2 2.x DOS sessions.
  15759.  
  15760.                !    If you use a memory manager like 386MAX or QEMM to
  15761.                     manage your UMBs, rather than the MS-DOS DOS=UMB
  15762.                     directive, then LOADHIGH will not work, and you must
  15763.                     use the equivalent command supplied with your memory
  15764.                     manager in order to load programs high.
  15765.  
  15766.                     See your 4DOS Introduction and Installation Guide for
  15767.                     complete details on UMBs and UMB regions, and the
  15768.                     hardware and software required to support them.
  15769.  
  15770.  
  15771.         -------------------------------------------------------------------
  15772.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 269
  15773.                                                    [4DOS]     LH / LOADHIGH
  15774.         -------------------------------------------------------------------
  15775.  
  15776.  
  15777.                ##   The /L and /S switches are designed to aid in
  15778.                     optimizing the use of upper memory by selecting one or
  15779.                     more UMB regions for a particular memory-resident
  15780.                     program to use.  They are fully compatible with the
  15781.                     MS-DOS 6.0 and above memory optimizer, MEMMAKER, and
  15782.                     may also be used under MS-DOS 5.0 and in OS/2 2.x DOS
  15783.                     sessions.  (They are not used by other memory
  15784.                     optimizers, such as QEMM's OPTIMIZE or 386MAX's
  15785.                     MAXIMIZE.)
  15786.  
  15787.                     While a complete discussion of memory optimization
  15788.                     techniques is well beyond the scope of this manual,
  15789.                     the basic technique is to load each memory-resident
  15790.                     program into a specific region to free up the maximum
  15791.                     possible amount of base memory.
  15792.  
  15793.                     Optimizing UMB usage requires a detailed knowledge of
  15794.                     the memory requirements for your memory-resident
  15795.                     programs.  This information can be very difficult to
  15796.                     obtain, because some programs require more memory when
  15797.                     starting and less when running, and each program is
  15798.                     unique.  However, if you know these memory
  15799.                     requirements, you may be able to use /L and /S to
  15800.                     optimize the use of upper memory, or to improve on the
  15801.                     optimization done by MEMMAKER or another memory
  15802.                     optimizer.
  15803.  
  15804.         Options: ## /L:r1,n1;r2,n2;...  (Load region):  Specifies which
  15805.                     region(s) should be used for the program, and
  15806.                     optionally the minimum free space required in a region
  15807.                     before the program is allowed access to that region.
  15808.  
  15809.                     If /L is not used, all upper memory regions are
  15810.                     available to the program.  If /L is used, you must
  15811.                     specify one or more regions (r1, r2, etc.); only those
  15812.                     regions will be made available.  Upper memory regions
  15813.                     are numbered sequentially beginning with 1 (region 0
  15814.                     refers to low memory, and is normally used only by
  15815.                     MEMMAKER).
  15816.  
  15817.                     If only a region number is given, the entire region is
  15818.                     made available to the program (assuming there is free
  15819.                     space in the region).  If a size is given for a
  15820.                     particular region (n1, n2, etc.), then the region is
  15821.                     only made available if the free space in the region is
  15822.                     equal to or greater than that size.  All sizes are in
  15823.                     bytes.  Any region not available to a particular
  15824.                     program is "locked out" while that program is loading
  15825.                     and made available again once the program is loaded.
  15826.                     If the combination of /L values you use does not
  15827.  
  15828.         -------------------------------------------------------------------
  15829.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 270
  15830.                                                    [4DOS]     LH / LOADHIGH
  15831.         -------------------------------------------------------------------
  15832.  
  15833.  
  15834.                     provide sufficient upper memory space for the program
  15835.                     to load, it will be loaded in low memory.
  15836.  
  15837.                     You can combine /L values in several ways.  In each of
  15838.                     the following examples, if the requested space is not
  15839.                     available or is insufficient the program is loaded
  15840.                     into low memory:
  15841.  
  15842.                          lh /l:2 filename
  15843.                               The program can use region 2 only.
  15844.  
  15845.                          lh /l:2;3 filename
  15846.                               The program can use regions 2 and 3 only.
  15847.  
  15848.                          lh /l:2,2048 filename
  15849.                               The program can use region 2 only, and only
  15850.                               if it has 2048 or more bytes free.
  15851.  
  15852.                          lh /l:2,2048;3 filename
  15853.                               The program can use region 2 if it has 2048
  15854.                               or more bytes free, and region 3 regardless
  15855.                               of how many bytes it has free
  15856.  
  15857.                ##   /S(hrink):  Shrinks each region selected by /L to the
  15858.                     minimum size used in /L before loading the program.
  15859.                     This prevents memory-resident programs which take all
  15860.                     available memory from using more than you want them
  15861.                     to.  This switch is primarily intended for use by
  15862.                     MEMMAKER.
  15863.  
  15864.  
  15865.  
  15866.  
  15867.  
  15868.  
  15869.  
  15870.  
  15871.  
  15872.  
  15873.  
  15874.  
  15875.  
  15876.  
  15877.  
  15878.  
  15879.  
  15880.  
  15881.  
  15882.  
  15883.  
  15884.  
  15885.         -------------------------------------------------------------------
  15886.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 271
  15887.                                                                        LIST
  15888.         -------------------------------------------------------------------
  15889.  
  15890.  
  15891.         LIST                                                          (New)
  15892.  
  15893.         Purpose:    Display a file, with forward and backward paging and
  15894.                     scrolling.
  15895.  
  15896.         Format:     LIST [/A[[:][-]rhsda] /H /S /W /X] file...
  15897.  
  15898.                     file:  A file or list of files to display.
  15899.  
  15900.                     /A(ttribute select)      /W(rap)
  15901.                     /H(igh bit off)          /X  (heX display mode)
  15902.                     /S(tandard input)
  15903.  
  15904.                     See also:  TYPE.
  15905.  
  15906.         Selection:  Supports extended wildcards, ranges, multiple file
  15907.                     names, and include lists (see pages 59 - 67).
  15908.  
  15909.         Usage:      LIST provides a much faster and more flexible way to
  15910.                     view a file than TYPE, without the overhead of loading
  15911.                     and using a text editor.
  15912.  
  15913.                     LIST is most often used for displaying ASCII text
  15914.                     files.  Most other files contain non-alphabetic
  15915.                     characters and may be unreadable, except in hex mode.
  15916.  
  15917.                     For example, to display a file called MEMO.DOC:
  15918.  
  15919.                          c:\> list memo.doc
  15920.  
  15921.                     LIST uses the cursor pad to scroll through the file.
  15922.                     The following keys have special meanings:
  15923.  
  15924.                          Home              Display the first page of the
  15925.                                            file.
  15926.                          End               Display the last page of the
  15927.                                            file.
  15928.                          Esc               Exit the current file.
  15929.                          Ctrl-C            Quit LIST.
  15930.                          Up Arrow          Scroll up one line.
  15931.                          Down Arrow        Scroll down one line.
  15932.                          Left Arrow        Scroll left 8 columns.
  15933.                          Right Arrow       Scroll right 8 columns.
  15934.                          Ctrl-Left Arrow   Scroll left 40 columns.
  15935.                          Ctrl-Right Arrow  Scroll right 40 columns.
  15936.                          F1                Display online help
  15937.                          B                 Go back to the previous file in
  15938.                                            the current group of files.
  15939.                          F                 Prompt and search for a string.
  15940.  
  15941.  
  15942.         -------------------------------------------------------------------
  15943.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 272
  15944.                                                                        LIST
  15945.         -------------------------------------------------------------------
  15946.  
  15947.  
  15948.                          G                 Go to a specific line or, in hex
  15949.                                            mode, to a specific hexadecimal
  15950.                                            offset.
  15951.                          H                 Toggle the "strip high bit" (/H)
  15952.                                            option.
  15953.                          I                 Display information on the
  15954.                                            current file (the full name,
  15955.                                            size, date, and time).
  15956.                          N                 Find next matching string.
  15957.                          P                 Print the current page or the
  15958.                                            entire file.
  15959.                          W                 Toggle the "line wrap" (/W)
  15960.                                            option.
  15961.                          X                 Toggle the hex-mode display (/X)
  15962.                                            option.
  15963.  
  15964.                     Text searches performed with F and N are not case-
  15965.                     sensitive.  However, if the display is currently in
  15966.                     hexadecimal mode and you press F, you will be prompted
  15967.                     for whether you want to search in hexadecimal as well.
  15968.                     If you answer Y, you should then enter the search
  15969.                     string as a sequence of 2-digit hexadecimal numbers
  15970.                     separated by spaces, for example 41 63 65 (these are
  15971.                     the ASCII values for the string "Ace"; see Appendix B
  15972.                     on page 371 for a complete list of ASCII codes).
  15973.                     Hexadecimal searches are case-sensitive, and search
  15974.                     for exactly the string you enter.
  15975.  
  15976.                     You can use wildcards in the search string.  For
  15977.                     example, you can search for the string "to*day" to
  15978.                     find the next line which contains the word "to"
  15979.                     followed by the word "day" later on the same line, or
  15980.                     search for the numbers "101" or "401" with the search
  15981.                     string "[14]01".  See page 59 for complete information
  15982.                     on wildcards.
  15983.  
  15984.                     LIST saves the search string used by F and N, so you
  15985.                     can LIST multiple files and search for the same string
  15986.                     simply by pressing N in each file, or repeat your
  15987.                     search the next time you use LIST.
  15988.  
  15989.                     LIST normally allows long lines in the file to extend
  15990.                     past the right edge of the screen.  You can use the
  15991.                     horizontal scrolling keys (see above) to view text
  15992.                     that extends beyond the screen width.  If you use the
  15993.                     W command or /W switch to wrap the display, each line
  15994.                     is wrapped when it reaches the right edge of the
  15995.                     screen, and the horizontal scrolling keys are
  15996.                     disabled.
  15997.  
  15998.  
  15999.         -------------------------------------------------------------------
  16000.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 273
  16001.                                                                        LIST
  16002.         -------------------------------------------------------------------
  16003.  
  16004.  
  16005.                     If you print the file which LIST is displaying, you
  16006.                     will be asked whether you wish to print the entire
  16007.                     file or the current display page.  The print format
  16008.                     will match the display format.  If you have switched
  16009.                     to hexadecimal or wrapped mode, that mode will be used
  16010.                     for the printed output as well.  If you print in
  16011.                     wrapped mode, long lines will be wrapped at the width
  16012.                     of the display.  If you print in normal display mode
  16013.                     without line wrap, long lines will be wrapped or
  16014.                     truncated by the printer, not by LIST.
  16015.  
  16016.                     Printed output normally goes to device LPT1.  If you
  16017.                     wish to send the printed output to another device, use
  16018.                     the Printer directive in the .INI file (see page 141).
  16019.  
  16020.                ##   Most of the LIST keystrokes can be reassigned with
  16021.                     .INI file directives (see pages 143 and 147).
  16022.  
  16023.                ##   You can set the colors used by LIST with the
  16024.                     ListColors and ListStatBarColors directives in the
  16025.                     .INI file.  If ListColors is not used, the LIST
  16026.                     display will use the current default colors.  If
  16027.                     ListStatBarColors is not used, the status bar will use
  16028.                     the reverse of the LIST display colors.
  16029.  
  16030.            4DOS ##  LIST normally writes text directly to the screen.  If
  16031.                     you have an unusual display adapter which does not
  16032.                     support direct video output, see the OutputBIOS
  16033.                     directive on page 150.
  16034.  
  16035.         Options: ## /A(ttribute select): Select only those files that have
  16036.                     the specified attribute(s) set.  Preceding the
  16037.                     attribute character with a hyphen [-] will select
  16038.                     files that do not have that attribute set.  The
  16039.                     attributes are:
  16040.  
  16041.                          R    Read-only         D    Subdirectory
  16042.                          H    Hidden            A    Archive
  16043.                          S    System
  16044.  
  16045.                     If no attributes are listed at all (e.g., LIST /A
  16046.                     ...), LIST will select all files and subdirectories
  16047.                     including hidden and system files.  If attributes are
  16048.                     combined, all the specified attributes must match for
  16049.                     a file to be selected.  For example, /A:RHS will
  16050.                     select only those files with all three attributes set.
  16051.                     See page 18 for more information on file attributes.
  16052.  
  16053.                ##   /H(igh bit off):  Strip the high bit from each
  16054.                     character before displaying.  This is useful when
  16055.  
  16056.         -------------------------------------------------------------------
  16057.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 274
  16058.                                                                        LIST
  16059.         -------------------------------------------------------------------
  16060.  
  16061.  
  16062.                     displaying files created by some word processors that
  16063.                     turn on the high bit for formatting purposes.  You can
  16064.                     toggle this option on and off from within LIST with
  16065.                     the H key.
  16066.  
  16067.                     /S(tandard input):  Read from standard input rather
  16068.                     than a file.  This allows you to redirect command
  16069.                     output and view it with LIST.  For example, to use
  16070.                     LIST to display the output of DIR:
  16071.  
  16072.                          c:\> dir | list /s
  16073.  
  16074.                     /W(rap):  Wrap the text at the right edge of the
  16075.                     screen.  This option is useful when displaying files
  16076.                     that don't have a carriage return at the end of each
  16077.                     line.  The horizontal scrolling keys do not work when
  16078.                     the display is wrapped.  You can toggle this option on
  16079.                     and off from within LIST with the W key.
  16080.  
  16081.                     /X (hex mode):  Display the file in hexadecimal (hex)
  16082.                     mode.  This option is useful when displaying
  16083.                     executable files and other files that contain non-text
  16084.                     characters.  Each byte of the file is shown as a pair
  16085.                     of hex characters.  The corresponding text is
  16086.                     displayed to the right of each line of hexadecimal
  16087.                     data.  You can toggle this mode on and off from within
  16088.                     LIST with the X key.
  16089.  
  16090.  
  16091.  
  16092.  
  16093.  
  16094.  
  16095.  
  16096.  
  16097.  
  16098.  
  16099.  
  16100.  
  16101.  
  16102.  
  16103.  
  16104.  
  16105.  
  16106.  
  16107.  
  16108.  
  16109.  
  16110.  
  16111.  
  16112.  
  16113.         -------------------------------------------------------------------
  16114.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 275
  16115.                                                                     LOADBTM
  16116.         -------------------------------------------------------------------
  16117.  
  16118.  
  16119.         LOADBTM                                                       (New)
  16120.  
  16121.         Purpose:    Switch a batch file to or from BTM mode.
  16122.  
  16123.         Format:     LOADBTM [ON | OFF]
  16124.  
  16125.         Usage:      4DOS, 4OS2, and 4DOS/NT recognize two kinds of batch
  16126.                     files: .BAT or .CMD, and .BTM.  Batch files executing
  16127.                     in BTM mode run two to five times faster than in BAT
  16128.                     or CMD mode.  (However, BTM mode should not be used to
  16129.                     load memory-resident programs in DOS, nor should BTM
  16130.                     mode be used for self-modifying batch files.)  Batch
  16131.                     files automatically start in the mode indicated by
  16132.                     their extension.  For more information on .BTM, .BAT,
  16133.                     and .CMD files, see page 80.
  16134.  
  16135.                     The LOADBTM command turns BTM mode on and off.  It can
  16136.                     be used to switch modes in either a .BAT   .CMD or                                                             /
  16137.                     .BTM file.  If you use LOADBTM with no argument, it
  16138.                     will display the current batch mode:  LOADBTM ON or
  16139.                     LOADBTM OFF.
  16140.  
  16141.                     LOADBTM can only be used within a batch file.  It is
  16142.                     most often used to switch a .BAT file into BTM mode
  16143.                     after memory-resident programs are loaded, to convert
  16144.                     a .BAT or .CMD file to BTM mode without changing its
  16145.                     extension, or to switch a .BTM file into BAT mode in
  16146.                     order to load memory-resident programs under DOS.
  16147.  
  16148.                     Using LOADBTM to repeatedly switch modes within a
  16149.                     batch file is not efficient.  In most cases the speed
  16150.                     gained by running some parts of the file in BTM mode
  16151.                     will be more than offset by the speed lost through
  16152.                     repeated loading of the file each time BTM mode is
  16153.                     invoked.
  16154.  
  16155.                     The following .BAT file fragment loads some memory
  16156.                     resident programs (TSRs), and then switches to BTM
  16157.                     mode:
  16158.  
  16159.                          rem   Because this file has a .BAT extension,
  16160.                          rem   the initial default state is LOADBTM OFF
  16161.                          rem   Loading TSRs...
  16162.                          ansi.com
  16163.                          mouse.com
  16164.                          rem   Switch to high-speed (BTM) mode now that
  16165.                          rem   TSRs are loaded
  16166.                          loadbtm on
  16167.                          path c:\;c:\util;c:\dos
  16168.                          alias /r c:\aliases
  16169.  
  16170.         -------------------------------------------------------------------
  16171.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 276
  16172.                                                                         LOG
  16173.         -------------------------------------------------------------------
  16174.  
  16175.  
  16176.         LOG                                                           (New)
  16177.  
  16178.         Purpose:    Save a log of commands to a disk file.
  16179.  
  16180.         Format:     LOG [/H /W file] [ON | OFF | text]
  16181.  
  16182.                     file:  The name of the file to hold the log.
  16183.                     text:  An optional message that will be added to the
  16184.                     log.
  16185.  
  16186.                     /H(istory log)              /W(rite to).
  16187.  
  16188.                     See also:  HISTORY.
  16189.  
  16190.         Usage:      LOG keeps a record of all internal and external
  16191.                     commands you use.  Each entry includes the current
  16192.                     system date and time, along with the actual command
  16193.                     after any alias or variable expansion (see page 121
  16194.                     for more information on alias and variable expansion).
  16195.                     You can use the log file as a record of your daily
  16196.                     activities.
  16197.  
  16198.                     LOG with the /H option keeps a similar record, but it
  16199.                     does not record the date and time for each command.
  16200.                     In addition, it records commands before aliases and
  16201.                     variables are expanded.
  16202.  
  16203.                     By default, LOG writes to the file 4DOSLOG,  4OS2LOG,
  16204.                     or 4NTLOG (depending on which command processor you
  16205.                     are using), in the root directory of the boot drive.
  16206.                     The corresponding default file names for LOG /H are
  16207.                     4DOSHLOG,  4OS2HLOG, and 4NTHLOG.
  16208.  
  16209.                     Entering LOG or LOG /H with no parameters displays the
  16210.                     name of the log file and the log status (ON or OFF):
  16211.  
  16212.                          c:\> log
  16213.                          LOG (C:\4DOSLOG) is OFF
  16214.  
  16215.                     To enable or disable logging, add the word "ON" or
  16216.                     "OFF" after the LOG command:
  16217.  
  16218.                          c:\> log on
  16219.  
  16220.                     or
  16221.  
  16222.                          c:\> log /h on
  16223.  
  16224.  
  16225.  
  16226.  
  16227.         -------------------------------------------------------------------
  16228.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 277
  16229.                                                                         LOG
  16230.         -------------------------------------------------------------------
  16231.  
  16232.  
  16233.                     Entering LOG or LOG /H with text writes a message to
  16234.                     the log file, even if logging  is set OFF.  This
  16235.                     allows you to enter headers in the log file:
  16236.  
  16237.                          c:\> log "Started work on the database system"
  16238.  
  16239.                     The LOG file format looks like this:
  16240.  
  16241.                          [mm-dd-yy  hh:mm:ss]  command
  16242.  
  16243.                     The LOG /H output can be used as the basis for writing
  16244.                     batch files.  Start LOG /H, then execute the commands
  16245.                     that you want the batch file to execute.  When you are
  16246.                     finished, turn LOG /H off.  The resulting file can be
  16247.                     turned into a batch file that performs the same
  16248.                     commands with little or no editing.
  16249.  
  16250.                     You can have both a regular log (with time and date
  16251.                     stamping) and a history log (without the time stamps)
  16252.                     enabled simultaneously.
  16253.  
  16254.         Options:    /H(istory log):  This option turns on (or off) the
  16255.                     history log, which saves commands without the time and
  16256.                     date stamp.  For example, to turn on history logging
  16257.                     and write to the file C:\LOG\HLOG:
  16258.  
  16259.                          c:\>  log /h /w c:\log\hlog
  16260.  
  16261.                     /W(rite):  This switch specifies a different filename
  16262.                     for the LOG or LOG /H output.  It also automatically
  16263.                     performs a LOG ON command.  For example, to turn
  16264.                     logging on and write the log to C:\LOG\LOGFILE:
  16265.  
  16266.                          c:\> log /w c:\log\logfile
  16267.  
  16268.                     Once you select a new file name with the LOG /W or LOG
  16269.                     /H/W command, LOG will use that file until you issue
  16270.                     another LOG /W or LOG /H/W command, or until you
  16271.                     reboot your computer.  Turning LOG or LOG /H off or on
  16272.                     does not change the file name.  You can set the
  16273.                     default log file names when your command processor
  16274.                     starts with the LogName and HistLogName directives in
  16275.                     the .INI file.
  16276.  
  16277.  
  16278.  
  16279.  
  16280.  
  16281.  
  16282.  
  16283.  
  16284.         -------------------------------------------------------------------
  16285.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 278
  16286.                                                                  MD / MKDIR
  16287.         -------------------------------------------------------------------
  16288.  
  16289.  
  16290.         MD / MKDIR                                               (Enhanced)
  16291.  
  16292.         Purpose:    Create a subdirectory.
  16293.  
  16294.         Format:     MD [/S] pathname...
  16295.  
  16296.                          or
  16297.  
  16298.                     MKDIR [/S] pathname...
  16299.  
  16300.                     pathname:  The name of one or more directories to
  16301.                     create.
  16302.  
  16303.                     /S(ubdirectories)
  16304.  
  16305.                     See also:  RD.
  16306.  
  16307.         Usage:      MD and MKDIR are synonyms.  You can use either one.
  16308.  
  16309.                     MD creates a subdirectory anywhere in the directory
  16310.                     tree.  To create a subdirectory from the root, start
  16311.                     the pathname with a backslash [\].  For example, this
  16312.                     command creates a subdirectory called MYDIR in the
  16313.                     root directory:
  16314.  
  16315.                          c:\> md \mydir
  16316.  
  16317.                     If no path is given, the new subdirectory is created
  16318.                     in the current directory.  This example creates a
  16319.                     subdirectory called DIRTWO in the current directory:
  16320.  
  16321.                          c:\mydir> md dirtwo
  16322.  
  16323.                     To create a directory from the parent of the current
  16324.                     directory (that is, to create a sibling of the current
  16325.                     directory), start the pathname with two periods and a
  16326.                     backslash [..\].
  16327.  
  16328.                     The operating system limits the permissible length of
  16329.                     the full subdirectory name.  See page 16 for details.
  16330.  
  16331.         Option:     /S(ubdirectories):  MD creates one directory at a time
  16332.                     unless you use the /S option.  If you need to create
  16333.                     the directory C:\ONE\TWO\THREE and none of the named
  16334.                     directories exist, you can use /S to have MD create
  16335.                     all of the necessary subdirectories for you in a
  16336.                     single command:
  16337.  
  16338.                          c:\> md /s \one\two\three
  16339.  
  16340.  
  16341.         -------------------------------------------------------------------
  16342.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 279
  16343.                                                                      MEMORY
  16344.         -------------------------------------------------------------------
  16345.  
  16346.  
  16347.         MEMORY                                                        (New)
  16348.  
  16349.         Purpose:    Display the amount and status of system RAM.
  16350.  
  16351.         Format:     MEMORY
  16352.  
  16353.         Usage:      MEMORY displays information about the RAM in your
  16354.                     system.
  16355.  
  16356.             4DOS    In 4DOS, MEMORY lists the amount of total RAM in your
  16357.                     system and the amount available for applications after
  16358.                     DOS, 4DOS, and memory-resident programs have been
  16359.                     laoded; the amount of EMS expanded memory, XMS
  16360.                     extended memory, and non-XMS extended memory; the HMA
  16361.                     status; and the amount of memory 4DOS is using for
  16362.                     environment variable space, alias space, and history
  16363.                          :                    space
  16364.  
  16365.                          c:\> memory
  16366.                              655,360 bytes total RAM
  16367.                              534,464 bytes free
  16368.  
  16369.                            1,687,552 bytes total EMS memory
  16370.                            1,097,728 bytes free
  16371.  
  16372.                              914,432 bytes total XMS memory (HMA in use)
  16373.  
  16374.                                  512 bytes total environment
  16375.                                  195 bytes free
  16376.  
  16377.                                1,024 bytes total alias
  16378.                                  452 bytes free
  16379.  
  16380.                                1,024 bytes total history
  16381.  
  16382.                     You can use the information from the MEMORY display to
  16383.                     fine tune your system, to aid in setting the proper
  16384.                     alias and environment sizes in 4DOS.INI, and to be
  16385.                     sure that you have sufficient memory for your largest
  16386.                     applications.
  16387.  
  16388.                     If you compare the free RAM displayed by MEMORY with
  16389.                     the free RAM displayed by CHKDSK and some memory map
  16390.                     programs, MEMORY will usually show a slightly higher
  16391.                     value.  The difference is the size of the environment
  16392.                     passed to these external programs; most memory mapping
  16393.                     programs do not count the passed environment as free
  16394.                     space, but MEMORY does.
  16395.  
  16396.  
  16397.  
  16398.         -------------------------------------------------------------------
  16399.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 280
  16400.                                                                      MEMORY
  16401.         -------------------------------------------------------------------
  16402.  
  16403.  
  16404.                     The MEMORY command displays for 4OS2 and 4DOS/NT are
  16405.                     somewhat different to reflect the way in which OS/2
  16406.                     and Windows NT organize the computer's memory.
  16407.  
  16408.             4OS2    A typical MEMORY display using 4OS2 is shown below:
  16409.  
  16410.                            16,379,904 bytes total physical RAM
  16411.                            40,546,048 bytes total resident RAM
  16412.                             5,050,368 bytes largest free block
  16413.  
  16414.                             3,145,728 bytes total swap file
  16415.  
  16416.                                 4,096 bytes total environment
  16417.                                 2,451 bytes free
  16418.  
  16419.                                 4,096 bytes total alias
  16420.                                 1,910 bytes free
  16421.  
  16422.                                 1,024 bytes total history
  16423.  
  16424.             4NT     A typical MEMORY display using 4DOS/NT is shown below:
  16425.  
  16426.                                  21 % Memory load
  16427.  
  16428.                            16,449,536 bytes total physical RAM
  16429.                             3,665,920 bytes available physical RAM
  16430.  
  16431.                            37,715,968 bytes total page file
  16432.                            19,038,208 bytes available page file
  16433.  
  16434.                                 4,096 bytes total environment
  16435.                                 3,192 bytes free
  16436.  
  16437.                                32,768 bytes total alias
  16438.                                32,767 bytes free
  16439.  
  16440.                                 1,024 bytes total history
  16441.  
  16442.  
  16443.  
  16444.  
  16445.  
  16446.  
  16447.  
  16448.  
  16449.  
  16450.  
  16451.  
  16452.  
  16453.  
  16454.  
  16455.         -------------------------------------------------------------------
  16456.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 281
  16457.                                                                        MOVE
  16458.         -------------------------------------------------------------------
  16459.  
  16460.  
  16461.         MOVE                                                          (New)
  16462.  
  16463.         Purpose:    Move files to a new directory and drive.
  16464.  
  16465.         Format:     MOVE  [/A[[:][-]rhsda] /C /D /F /H /M /N /P /Q /R /S
  16466.                     /T /U /V] source...  destination
  16467.  
  16468.                     source:  A file or list of files to move.
  16469.                     destination:  The new location for the files.
  16470.  
  16471.                     /A(ttribute select)      /P(rompt)
  16472.                     /C(hanged)               /Q(uiet)
  16473.                     /D(irectory)             /R(eplace)
  16474.                     /F(orce delete)          /S(ubdirectory tree)
  16475.                     /H(idden and system)     /T(otal)
  16476.                     /M(odified files)        /U(pdate)
  16477.                     /N(othing)               /V(erify)
  16478.  
  16479.  
  16480.                     See also:  COPY and RENAME.
  16481.  
  16482.         Selection:  Supports extended wildcards, ranges, multiple file
  16483.                     names, and include lists (see pages 59 - 67).  Date,
  16484.                     time, or size ranges anywhere on the line apply to all
  16485.                     source files.
  16486.  
  16487.         Usage:      The MOVE command moves one or more files from one
  16488.                     directory to another, whether the directories are on
  16489.                     the same drive or not.  It has the same effect as
  16490.                     copying the files to a new location and then deleting
  16491.                     the originals.  Like COPY and RENAME, MOVE works with
  16492.                     single files, multiple files, and sets of files
  16493.                     specified with an include list.
  16494.  
  16495.                     The simplest MOVE command moves a single source file
  16496.                     to a new location and, optionally, gives it a new
  16497.                     name.  These two examples both move one file from
  16498.                     drive C: to the root directory on drive A:
  16499.  
  16500.                          c:\> move myfile.dat a:\
  16501.                          c:\> move myfile.dat a:\savefile.dat
  16502.  
  16503.                     In both cases, MYFILE.DAT is removed from drive C:
  16504.                     after it has been copied to drive A:.  If a file
  16505.                     called MYFILE.DAT in the first example, or
  16506.                     SAVEFILE.DAT in the second example, already existed on
  16507.                     drive A:, it would be overwritten.  (This demonstrates
  16508.                     the difference between MOVE and RENAME.  MOVE will
  16509.                     move files between drives and will overwrite the
  16510.                     destination file if it exists; RENAME will not.)
  16511.  
  16512.         -------------------------------------------------------------------
  16513.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 282
  16514.                                                                        MOVE
  16515.         -------------------------------------------------------------------
  16516.  
  16517.  
  16518.                     If you MOVE multiple files, the destination must be a
  16519.                     directory name.  MOVE will move each file into the
  16520.                     destination directory with its original name (if the
  16521.                     target is not a directory, MOVE will display an error
  16522.                     message and exit):
  16523.  
  16524.                          c:\> move *.wks *.txt c:\finance\myfiles
  16525.  
  16526.                     You cannot move a file to a character device like the
  16527.                     printer, or to itself.
  16528.  
  16529.                     When you move files to another directory, if you add a
  16530.                     backslash [\] to the end of the destination name MOVE
  16531.                     will display an error message if the name does not
  16532.                     refer to an existing directory.  You can use this
  16533.                     feature to keep MOVE from treating a mistyped
  16534.                     destination directory name as a file name, and
  16535.                     attempting to move all source files to that name.  The
  16536.                     /D option performs the same function but will also
  16537.                     prompt to see if you want to create the destination
  16538.                     directory if it doesn't exist.
  16539.  
  16540.                !    Be careful when you use MOVE with the SELECT command.
  16541.                     If you SELECT multiple files and the target is not a
  16542.                     directory (for example, because of a misspelling),
  16543.                     MOVE will assume it is a file name.  In this case each
  16544.                     file will be moved in turn to the target file,
  16545.                     overwriting the previous file, and then the original
  16546.                     will be erased before the next file is moved.  At the
  16547.                     end of the command, all of the original files will
  16548.                     have been erased and only the last file will exist as
  16549.                     the target file.  You can avoid this problem by using
  16550.                     square brackets with SELECT instead of parentheses (be
  16551.                     sure that you don't allow the command line to get too
  16552.                     long - watch the character count in the upper left
  16553.                     corner while you're selecting files).  MOVE will then
  16554.                     receive one list of files to move instead of a series
  16555.                     of individual filenames, and it will detect the error
  16556.                     and halt.  You can also add a backslash [\] to the end
  16557.                     of the destination name to ensure that it is the name
  16558.                     of a subdirectory (see above).
  16559.  
  16560.                ##   MOVE first attempts to rename the file(s), which is
  16561.                     the fastest way to move files between subdirectories
  16562.                     on the same drive.  If that fails (the destination is
  16563.                     on a different drive or already exists), MOVE will
  16564.                     copy the file(s) and then delete the originals.
  16565.  
  16566.                ##   If you are using 4DOS in an OS/2 DOS session, MOVE
  16567.                     will copy OS/2 extended attributes from the source to
  16568.  
  16569.         -------------------------------------------------------------------
  16570.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 283
  16571.                                                                        MOVE
  16572.         -------------------------------------------------------------------
  16573.  
  16574.  
  16575.                     the destination, provided the file system on the
  16576.                     destination drive supports them.
  16577.  
  16578.                ##   If MOVE must physically copy the files and delete the
  16579.                     originals, rather than renaming them (see above), then
  16580.                     some disk space may be freed on the source drive.  The
  16581.                     free space may be the result of moving the files to
  16582.                     another drive, or of overwriting a larger destination
  16583.                     file with a smaller source file.  MOVE displays the
  16584.                     amount of disk space recovered unless the /Q option is
  16585.                     used (see below).  It does so by comparing the amount
  16586.                     of free disk space before and after the MOVE command
  16587.                     is executed.  However, this amount may be incorrect if
  16588.                     you are using a deletion tracking system which stores
  16589.                     deleted files in a hidden directory, or if, under a
  16590.                     multitasking system, another program performs a file
  16591.                     operation while the MOVE command is executed.
  16592.  
  16593.                ##   When physically copying files, MOVE preserves the
  16594.                     hidden, system, and read-only attributes of the source
  16595.                     files, and sets the archive attribute of the
  16596.                     destination files.  However, if the files can be
  16597.                     renamed, and no copying is required, then the source
  16598.                     file attributes are not changed.
  16599.  
  16600.             4NT  ## If you MOVE files with long filenames from an NTFS
  16601.                     volume to a FAT volume, 4DOS/NT will now store the
  16602.                     destination files with their short, FAT-compatible
  16603.                     names when running under Windows NT 3.1 (long names
  16604.                     are used under Windows NT 3.5 and above; see page 18
  16605.                     for additional details).  You can view the short names
  16606.                     before executing the MOVE with the DIR /X command.
  16607.  
  16608.         Options: ## /A(ttribute select): Select only those files that have
  16609.                     the specified attribute(s) set.  Preceding the
  16610.                     attribute character with a hyphen [-] will select
  16611.                     files that do not have that attribute set.  The
  16612.                     attributes are:
  16613.  
  16614.                          R    Read-only         D    Subdirectory
  16615.                          H    Hidden            A    Archive
  16616.                          S    System
  16617.  
  16618.                     If no attributes are listed at all (e.g., MOVE /A
  16619.                     ...), MOVE will select all files and subdirectories
  16620.                     including hidden and system files.  If attributes are
  16621.                     combined, all the specified attributes must match for
  16622.                     a file to be selected.  For example, /A:RHS will
  16623.                     select only those files with all three attributes set.
  16624.                     See page 18 for more information on file attributes.
  16625.  
  16626.         -------------------------------------------------------------------
  16627.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 284
  16628.                                                                        MOVE
  16629.         -------------------------------------------------------------------
  16630.  
  16631.  
  16632.                     /C(hanged files):  Move files only if the destination
  16633.                     file exists and is older than the source (see also
  16634.                     /U).  This option is useful for updating the files in
  16635.                     one directory from those in another without moving any
  16636.                     newly-created files.
  16637.  
  16638.                     /D(irectory):  Requires that the destination be a
  16639.                     directory.  If the destination does not exist, MOVE
  16640.                     will prompt to see if you want to create it.  If the
  16641.                     destination exists as a file, MOVE will fail with an
  16642.                     "Access denied" error.  Use this option to avoid
  16643.                     having MOVE accidentally interpret your destination
  16644.                     name as a file name when it's really a mistyped
  16645.                     directory name.
  16646.  
  16647.                ##   /F(orce delete):  This option is only for use in the
  16648.                     32-bit version of 4OS2, and in 4DOS when running in an
  16649.                     OS/2 2.1 or later DOS session.  It forces deletion of
  16650.                     the source file without saving it to the DELDIR
  16651.                     directory (if DELDIR is not in use, /F has no effect).
  16652.  
  16653.                ##   /H(idden):  Move all files, including hidden and
  16654.                     system files.
  16655.  
  16656.                     /M(odified files):  Move only files that have the
  16657.                     archive bit set.  The archive bit will remain set
  16658.                     after the MOVE; to clear it use ATTRIB (page 173).
  16659.  
  16660.                     /N(othing):  Do everything except actually move the
  16661.                     file(s).  This option is most useful for testing what
  16662.                     a complex MOVE command will do.
  16663.  
  16664.                     /P(rompt):  Prompt the user to confirm each move.
  16665.                     Your options at the prompt are explained in detail on
  16666.                     page 50.
  16667.  
  16668.                     /Q(uiet):  Don't display filenames, the total number
  16669.                     of files moved, or the amount of disk space recovered,
  16670.                     if any.  This option is most often used in batch
  16671.                     files.  See also /T.
  16672.  
  16673.                     /R(eplace):  Prompt for a Y or N response before
  16674.                     overwriting an existing destination file.
  16675.  
  16676.                     /S(ubdirectories):  Move an entire subdirectory tree
  16677.                     to another location.  MOVE will attempt to create the
  16678.                     destination directories if they don't exist, and will
  16679.                     remove empty subdirectories after the move.  When /D
  16680.                     is used with /S, you will be prompted if the first
  16681.                     destination directory does not exist, but
  16682.  
  16683.         -------------------------------------------------------------------
  16684.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 285
  16685.                                                                        MOVE
  16686.         -------------------------------------------------------------------
  16687.  
  16688.  
  16689.                     subdirectories below that will be created
  16690.                     automatically by MOVE.  If you attempt to use /S to
  16691.                     move a subdirectory tree into part of itself, MOVE
  16692.                     will display an error message and halt.
  16693.  
  16694.                     /T(otal):  Don't display filenames as they are moved,
  16695.                     but display the total number of files deleted and the
  16696.                     amount of free disk space recovered, if any.
  16697.  
  16698.                     /U(pdate):  Move each source file only if it is newer
  16699.                     than a matching destination file or if a matching
  16700.                     destination file does not exist (also see /C).  This
  16701.                     option is useful for moving new or changed files from
  16702.                     one directory to another.
  16703.  
  16704.                ##   /V(erify):  Verify each disk write.  This is the same
  16705.                     as executing the VERIFY ON command, but is only active
  16706.                     during the MOVE.  /V does not read back the file and
  16707.                     compare its contents with what was written; it only
  16708.                     verifies that the data written to disk is physically
  16709.                     readable.
  16710.  
  16711.  
  16712.  
  16713.  
  16714.  
  16715.  
  16716.  
  16717.  
  16718.  
  16719.  
  16720.  
  16721.  
  16722.  
  16723.  
  16724.  
  16725.  
  16726.  
  16727.  
  16728.  
  16729.  
  16730.  
  16731.  
  16732.  
  16733.  
  16734.  
  16735.  
  16736.  
  16737.  
  16738.  
  16739.  
  16740.         -------------------------------------------------------------------
  16741.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 286
  16742.                                                        [4DOS/NT]     MSGBOX
  16743.         -------------------------------------------------------------------
  16744.  
  16745.  
  16746.         MSGBOX      [4DOS/NT]                                         (New)
  16747.  
  16748.         Purpose:    Display a message box and collect the user's response.
  16749.  
  16750.         Format:     MSGBOX  OK | OKCANCEL | YESNO | YESNOCANCEL ["title"]
  16751.                     prompt
  16752.  
  16753.                     title:  Text for the title bar of the message box.
  16754.                     prompt:  Text that will appear inside the message box.
  16755.  
  16756.         Usage:      MSGBOX can display one of 4 kinds of message boxes and
  16757.                     wait for the user's response.  You can use title and
  16758.                     prompt to display any text you wish.  4DOS/NT
  16759.                     automatically sizes and locates the box on the screen.
  16760.  
  16761.                     The message box may have 1, 2, or 3 response buttons.
  16762.                     The command MSGBOX OK creates a single-button box; the
  16763.                     user must simply acknowledge the prompt text.
  16764.  
  16765.                     The OKCANCEL and YESNO forms have 2 buttons each.  The
  16766.                     YESNOCANCEL form has 3 buttons.  The button the user
  16767.                     chooses is returned in the 4DOS/NT variable %_?.  Be
  16768.                     sure to save the return value in another variable or
  16769.                     test it immediately; the value of %_? changes with
  16770.                     every internal command.
  16771.  
  16772.                     The following list shows the value returned for each
  16773.                     possible selection:
  16774.  
  16775.                          Yes       10           No        11
  16776.                          OK        10           Cancel    12
  16777.  
  16778.                     If you exit the message box without selecting one of
  16779.                     these options (for example, some message boxes allow
  16780.                     you to exit by pressing Esc or double-clicking the
  16781.                     close button), MSGBOX will set %_? to 0.  If there is
  16782.                     an error in the MSGBOX command itself, %_? will be set
  16783.                     as described on page 102.
  16784.  
  16785.  
  16786.  
  16787.  
  16788.  
  16789.  
  16790.  
  16791.  
  16792.  
  16793.  
  16794.  
  16795.  
  16796.  
  16797.         -------------------------------------------------------------------
  16798.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 287
  16799.                                                                          ON
  16800.         -------------------------------------------------------------------
  16801.  
  16802.  
  16803.         ON                                                            (New)
  16804.  
  16805.         Purpose:    Execute a command in a batch file when a specific
  16806.                     condition occurs.
  16807.  
  16808.         Format:     ON BREAK [command]
  16809.                          or
  16810.                     ON ERROR [command]
  16811.  
  16812.         Usage:      ON can only by used in batch files.
  16813.  
  16814.                     ON sets a "watchdog" that remains in effect for the
  16815.                     duration of the current batch file.  Whenever a BREAK
  16816.                     or ERROR condition occurs after ON has been executed,
  16817.                     the command is automatically executed.
  16818.  
  16819.                     ON BREAK will execute its command if the user presses
  16820.                     Ctrl-C or Ctrl-Break.
  16821.  
  16822.                     ON ERROR will execute its command after any command
  16823.                     processor or operating system error (including
  16824.                     critical errors; see page 51).  That is, ON ERROR will
  16825.                     detect errors such as a disk write error, and 4DOS,
  16826.                     4OS2, or 4DOS/NT errors such as a COPY command that
  16827.                     fails to copy any files, or the use of an unacceptable
  16828.                     command option.
  16829.  
  16830.                     ON BREAK and ON ERROR are independent of each other.
  16831.                     You can use either one, or both, in any batch file.
  16832.  
  16833.                     Each time ON BREAK or ON ERROR is used, it defines a
  16834.                     new command to be executed for a break or error, and
  16835.                     any old command is discarded.  If you use ON BREAK or
  16836.                     ON ERROR with no following command, that type of error
  16837.                     handling is disabled.  Error handling is also
  16838.                     automatically disabled when the batch file exits.
  16839.  
  16840.                     ON BREAK and ON ERROR only affect the current batch
  16841.                     file.  If you CALL another batch file, the first batch
  16842.                     file's error handling is suspended, and the CALLed
  16843.                     file must define its own error handling.  When control
  16844.                     returns to the first batch file, its error handling is
  16845.                     reactivated.
  16846.  
  16847.                     The command can be any command that can be used on a
  16848.                     batch file line by itself.  Frequently, it is a GOTO
  16849.                     or GOSUB command.  For example, the following fragment
  16850.                     traps any user attempt to end the batch file by
  16851.                     pressing Ctrl-C or Ctrl-Break.  It scolds the user for
  16852.  
  16853.  
  16854.         -------------------------------------------------------------------
  16855.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 288
  16856.                                                                          ON
  16857.         -------------------------------------------------------------------
  16858.  
  16859.  
  16860.                     trying to end the batch file and then continues
  16861.                     displaying the numbers from 1 to 1000:
  16862.  
  16863.                          on break gosub gotabreak
  16864.                          do i = 1 to 1000
  16865.                            echo %i
  16866.                          enddo
  16867.                          quit
  16868.                          :gotabreak
  16869.                          echo Hey!  Stop that!!
  16870.                          return
  16871.  
  16872.                     You can use a command group (see page 71) as the
  16873.                     command if you want to execute multiple commands, for
  16874.                     example:
  16875.  
  16876.                          on break (echo Oops, got a break!^quit)
  16877.  
  16878.                     ON BREAK and ON ERROR always assume that you want to
  16879.                     continue executing the batch file.  After the command
  16880.                     is executed, control automatically returns to the next
  16881.                     command in the batch file (the command after the one
  16882.                     that was interrupted by the break or error).  The only
  16883.                     way to avoid continuing the batch file after a break
  16884.                     or error is for the command to transfer control to
  16885.                     another point with GOTO, end the batch file with QUIT
  16886.                     or CANCEL, or start another batch file (without
  16887.                     CALLing it).
  16888.  
  16889.                     When handling an error condition with ON ERROR, you
  16890.                     may find it useful to use internal variables (see page
  16891.                     100), particularly %_? and %_SYSERR, to help determine
  16892.                     the cause of the error.
  16893.  
  16894.                !    If a break or error occurs while the command specified
  16895.                     in ON BREAK or ON ERROR is executing, the command will
  16896.                     be restarted.  This means you must use caution to
  16897.                     avoid or handle any possible errors in the commands
  16898.                     invoked by ON ERROR, since such errors can cause an
  16899.                     infinite loop and/or a stack overflow condition.
  16900.  
  16901.  
  16902.  
  16903.  
  16904.  
  16905.  
  16906.  
  16907.  
  16908.  
  16909.  
  16910.  
  16911.         -------------------------------------------------------------------
  16912.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 289
  16913.                                                                        PATH
  16914.         -------------------------------------------------------------------
  16915.  
  16916.  
  16917.         PATH                                                     (Enhanced)
  16918.  
  16919.         Purpose:    Display or alter the list of directories that 4DOS,
  16920.                     4OS2, or 4DOS/NT will search for executable files,
  16921.                     batch files, and files with executable extensions that
  16922.                     are not in the current directory.
  16923.  
  16924.         Format:     PATH [directory[;directory...]]
  16925.  
  16926.                     directory:  The full name of a directory to include in
  16927.                     the path setting.
  16928.  
  16929.                     See also:  ESET and SET.
  16930.  
  16931.         Usage:      When the command processor is asked to execute an
  16932.                     external command (a .COM, .EXE, .BTM, .BAT, or .CMD
  16933.                     file or executable extension), it first looks for the
  16934.                     file in the current directory.  If it fails to find an
  16935.                     executable file there, it then searches each of the
  16936.                     directories specified in the PATH setting.  See page
  16937.                     20 for more details on how the path is searched.
  16938.  
  16939.                     For example, after the following PATH command, the
  16940.                     command processor will search for an executable file
  16941.                     in four directories:  the current directory, then the
  16942.                     root directory on drive C, then the DOS subdirectory
  16943.                     on C, and then the UTIL subdirectory on C:
  16944.  
  16945.                          c:\> path c:\;c:\dos;c:\util
  16946.  
  16947.                     The list of directories to search can be set or viewed
  16948.                     with the PATH command.  The list is stored as an
  16949.                     environment string, and can also be set or viewed with
  16950.                     SET, and edited with ESET.
  16951.  
  16952.                     Directory names in the path must be separated by
  16953.                     semicolons [;].  Each directory name is shifted to
  16954.                     upper case to maintain compatibility with programs
  16955.                     which can only recognize upper case directory names in
  16956.                     the path.  If you modify your path with the SET or
  16957.                     ESET command, you may include directory names in lower
  16958.                     case.  These may cause trouble with some programs,
  16959.                     which assume that all path entries have been shifted
  16960.                     to upper case.
  16961.  
  16962.                     If you enter PATH with no parameters, the current path
  16963.                     is displayed:
  16964.  
  16965.                          c:\> path
  16966.                          PATH=C:\;C:\DOS;C:\UTIL
  16967.  
  16968.         -------------------------------------------------------------------
  16969.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 290
  16970.                                                                        PATH
  16971.         -------------------------------------------------------------------
  16972.  
  16973.  
  16974.                     Entering PATH and a semicolon clears the search path
  16975.                     so that only the current directory is searched for
  16976.                     executable files (this is the default at system
  16977.                     startup).
  16978.  
  16979.                     Some applications also use the PATH to search for
  16980.                     their data files.
  16981.  
  16982.                ##   If you include an explicit file extension on a command
  16983.                     name (for example, WP.EXE), the search will find files
  16984.                     with that name and extension in the current directory
  16985.                     and every directory in the path.  It will not locate
  16986.                     other executable files with the same base name.
  16987.  
  16988.                ##   If you have an entry in the path which consists of a
  16989.                     single period [.], the current directory will not be
  16990.                     searched first, but instead will be searched when the
  16991.                     command processor reaches the "." in the path.  This
  16992.                     allows you to delay the search of the current
  16993.                     directory for executable files and files with
  16994.                     executable extensions.  In rare cases, this feature
  16995.                     may not be compatible with applications which use the
  16996.                     path to find their files; if you experience a problem,
  16997.                     you will have to remove the "." from the path while
  16998.                     using any such application.
  16999.  
  17000.             4DOS ## In normal use, 4DOS can create a path as long as 250
  17001.                     characters (the command-line limit is 255 characters,
  17002.                     and "PATH " takes five).  However, some DOS
  17003.                     applications expect a path no longer than the
  17004.                     traditional limit of 123 characters.  If you extend
  17005.                     your path beyond this limit and experience problems
  17006.                     with application programs, see Appendix A of the 4DOS
  17007.                     Introduction and Installation Guide for tips on
  17008.                     resolving the difficulty.
  17009.  
  17010.                ##   To create a path longer than the command-line length
  17011.                     limit, use PATH repeatedly to append additional
  17012.                     directories to the path:
  17013.  
  17014.                          path [first list of directories]
  17015.                          path %path;[second list of directories]
  17016.                          ...
  17017.  
  17018.                     You cannot use this method to extend the path beyond
  17019.                     506 characters in 4DOS or 2042 characters in 4OS2 and
  17020.                     4DOS/NT (the internal buffer limits, with room for
  17021.                     "PATH").  It is usually more efficient to use aliases
  17022.                     to load application programs than to create a long
  17023.                     PATH.  See ALIAS on page 161 for details.
  17024.  
  17025.         -------------------------------------------------------------------
  17026.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 291
  17027.                                                                        PATH
  17028.         -------------------------------------------------------------------
  17029.  
  17030.  
  17031.                     If you specify an invalid directory in the path, it
  17032.                     will be skipped and the search will continue with the
  17033.                     next directory in the path.
  17034.  
  17035.  
  17036.  
  17037.  
  17038.  
  17039.  
  17040.  
  17041.  
  17042.  
  17043.  
  17044.  
  17045.  
  17046.  
  17047.  
  17048.  
  17049.  
  17050.  
  17051.  
  17052.  
  17053.  
  17054.  
  17055.  
  17056.  
  17057.  
  17058.  
  17059.  
  17060.  
  17061.  
  17062.  
  17063.  
  17064.  
  17065.  
  17066.  
  17067.  
  17068.  
  17069.  
  17070.  
  17071.  
  17072.  
  17073.  
  17074.  
  17075.  
  17076.  
  17077.  
  17078.  
  17079.  
  17080.  
  17081.  
  17082.         -------------------------------------------------------------------
  17083.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 292
  17084.                                                                       PAUSE
  17085.         -------------------------------------------------------------------
  17086.  
  17087.  
  17088.         PAUSE                                                    (Enhanced)
  17089.  
  17090.         Purpose:    Suspend batch file or alias execution.
  17091.  
  17092.         Format:     PAUSE [text]
  17093.  
  17094.                     text:  The message to be displayed as a user prompt.
  17095.  
  17096.         Usage:      A PAUSE command will suspend execution of a batch file
  17097.                     or alias, giving you the opportunity to change disks,
  17098.                     turn on the printer, etc.
  17099.  
  17100.                     PAUSE waits for any key to be pressed and then
  17101.                     continues execution.  You can specify the text that
  17102.                     PAUSE displays while it waits for a keystroke, or let
  17103.                     4DOS use the default message:
  17104.  
  17105.                          Press any key when ready...
  17106.  
  17107.                     For example, the following batch file fragment prompts
  17108.                     the user before erasing files (the PAUSE command
  17109.                     should be entered on one line):
  17110.  
  17111.                          pause Press Ctrl-C to abort, any other key to
  17112.                            erase all .LST files
  17113.                          erase *.lst
  17114.  
  17115.                     If you press Ctrl-C or Ctrl-Break while PAUSE is
  17116.                     waiting for a key, execution of an alias will be
  17117.                     terminated, and execution of a batch file will be
  17118.                     suspended while you are asked whether to cancel the
  17119.                     batch job (see page 85).  In a batch file you can
  17120.                     handle Ctrl-C and Ctrl-Break yourself with the ON
  17121.                     BREAK command (see page 288).
  17122.  
  17123.  
  17124.  
  17125.  
  17126.  
  17127.  
  17128.  
  17129.  
  17130.  
  17131.  
  17132.  
  17133.  
  17134.  
  17135.  
  17136.  
  17137.  
  17138.  
  17139.         -------------------------------------------------------------------
  17140.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 293
  17141.                                                                        POPD
  17142.         -------------------------------------------------------------------
  17143.  
  17144.  
  17145.         POPD                                                          (New)
  17146.  
  17147.         Purpose:    Return to the disk drive and directory at the top of
  17148.                     the directory stack.
  17149.  
  17150.         Format:     POPD [*]
  17151.  
  17152.                     See also:  DIRS and PUSHD.
  17153.  
  17154.         Usage:      Each time you use the PUSHD command, it saves the
  17155.                     current disk drive and directory on the internal
  17156.                     directory stack.  POPD restores the last drive and
  17157.                     directory that was saved with PUSHD and removes that
  17158.                     entry from the stack.  You can use these commands
  17159.                     together to change directories, perform some work, and
  17160.                     return to the starting drive and directory.
  17161.  
  17162.                     Directory changes made with POPD are recorded for
  17163.                     display in the directory history window (see page 45).
  17164.  
  17165.                     This example saves and changes the current disk drive
  17166.                     and directory with PUSHD, and then restores it.  The
  17167.                     current directory is shown in the prompt:
  17168.  
  17169.                          c:\> pushd d:\database\test
  17170.                          d:\database\test> pushd c:\wordp\memos
  17171.                          c:\wordp\memos> pushd a:\123
  17172.                          a:\123> popd
  17173.                          c:\wordp\memos> popd
  17174.                          d:\database\test> popd
  17175.                          c:\>
  17176.  
  17177.                     You can use the DIRS command to see the complete list
  17178.                     of saved drives and directories (the directory stack).
  17179.  
  17180.                     The POPD command followed by an asterisk [*] clears
  17181.                     the directory stack without changing the current drive
  17182.                     and directory.
  17183.  
  17184.                ##   If the directory on the top of the stack is not on the
  17185.                     current drive, POPD will switch to the drive and
  17186.                     directory on the top of the stack without changing the
  17187.                     default directory on the current drive.
  17188.  
  17189.  
  17190.  
  17191.  
  17192.  
  17193.  
  17194.  
  17195.  
  17196.         -------------------------------------------------------------------
  17197.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 294
  17198.                                                                      PROMPT
  17199.         -------------------------------------------------------------------
  17200.  
  17201.  
  17202.         PROMPT                                                   (Enhanced)
  17203.  
  17204.         Purpose:    Change the command-line prompt.
  17205.  
  17206.         Format:     PROMPT [text]
  17207.  
  17208.                     text:  Text to be used as the new command-line prompt.
  17209.  
  17210.         Usage:      You can change and customize the command-line prompt
  17211.                     at any time.  The prompt can include normal text, and
  17212.                     system information such as the current drive and
  17213.                     directory, the time and date, and the amount of memory
  17214.                     available.  You can create an informal "Hello, Bob!"
  17215.                     prompt or an official-looking prompt full of
  17216.                     impressive information.
  17217.  
  17218.                     The prompt text can contain special commands in the
  17219.                     form $?, where ? is one of the characters listed
  17220.                     below:
  17221.  
  17222.                          b    The vertical bar character [|].
  17223.                          c    The open parenthesis [(].
  17224.                          d    Current date, in the format:  Fri  Jan 7,
  17225.                               1994.
  17226.                          D    Current date, in the format:  Fri  1-07-94
  17227.                               (the month, day, and year are formatted
  17228.                               according to your current country settings).
  17229.                          e    The ASCII ESC character (decimal 27).
  17230.                          f    The close parenthesis [)].
  17231.                          g    The > character.
  17232.                          h    Backspace over the previous character.
  17233.                          i    Display the OS/2 prompt header line, which
  17234.                               reminds you of how to return to the OS/2
  17235.                               desktop, or get help.
  17236.                          l    The < character.
  17237.                          m    Time in hours and minutes using 24-hour
  17238.                               format.
  17239.                          M    Time in hours and minutes using the default
  17240.                               country format and retaining "a" or "p",
  17241.                               e.g. 4:07p.
  17242.                          n    Current drive letter.
  17243.                          p    Current drive and directory (lower case).
  17244.                          P    Current drive and directory (upper case).
  17245.                          q    The = character.
  17246.                          r    The numeric exit code of the last external
  17247.                               command.
  17248.                          s    The space character.
  17249.                          t    Current 24-hour time, in the format
  17250.                               hh:mm:ss.
  17251.  
  17252.  
  17253.         -------------------------------------------------------------------
  17254.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 295
  17255.                                                                      PROMPT
  17256.         -------------------------------------------------------------------
  17257.  
  17258.  
  17259.                          T    Current 12-hour time, in the format
  17260.                               hh:mm:ss[a|p].
  17261.                          v    Operating system version number, in the
  17262.                               format 3.10.
  17263.                          xd:  Current directory on drive d:, in lower
  17264.                               case.  (Uses the actual case of the
  17265.                               directory name as stored on the disk for
  17266.                               HPFS and NTFS drives, and FAT drives under
  17267.                               Windows NT 3.5 and above; see page 17 for
  17268.                               details).
  17269.                          Xd:  Current directory on drive d:, in upper
  17270.                               case.
  17271.                          z    Current shell nesting level; the primary
  17272.                               command processor is shell 0.
  17273.                          $    The $ character.
  17274.                          _    CR/LF (go to beginning of a new line).
  17275.  
  17276.                     For example, to set the prompt to the current date and
  17277.                     time, with a ">" at the end:
  17278.  
  17279.                          c:\> prompt $d $t $g
  17280.                          Fri  Dec 3, 1993 10:29:19 >
  17281.  
  17282.                     To set the prompt to the current date and time,
  17283.                     followed by the current drive and directory in upper
  17284.                     case on the next line, with a ">" at the end:
  17285.  
  17286.                          c:\> prompt $d $t$_$P$g
  17287.                          Fri  Dec 3, 1993 10:29:19
  17288.                          C:\>
  17289.  
  17290.                     Under DOS, you can include the PROMPT command in your
  17291.                     AUTOEXEC.BAT file to set the prompt whenever your
  17292.                     system is rebooted.  The 4OS2 prompt can be set in
  17293.                     CONFIG.SYS (see below), and the prompt for any command
  17294.                     processor can be set in 4START (see page 85), or in
  17295.                     any batch file that runs when the command processor
  17296.                     starts.
  17297.  
  17298.             4DOS    The default prompt is $n$g (drive name plus ">") on
  17299.                     drives A and B, and $p$g (current drive and directory
  17300.                     plus ">") on all other drives.  If you use 4DOS under
  17301.                     OS/2, the SET PROMPT statement in the OS/2 CONFIG.SYS
  17302.                     file (see next paragraph) will override the default
  17303.                     4DOS prompt.  You must delete this statement if you
  17304.                     want to use the default prompt.
  17305.  
  17306.             4OS2    The 4OS2 default prompt is [$n] (drive name in square
  17307.                     brackets) on floppy drives, and [$p] (current drive
  17308.                     and directory in square brackets) on all other drives.
  17309.  
  17310.         -------------------------------------------------------------------
  17311.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 296
  17312.                                                                      PROMPT
  17313.         -------------------------------------------------------------------
  17314.  
  17315.  
  17316.                     When OS/2 is installed, it inserts a SET PROMPT
  17317.                     statement in CONFIG.SYS to set the prompt to $i[$p].
  17318.                     This prompt will override the 4OS2 defaults.  The $i
  17319.                     adds a header line to the default prompt to remind you
  17320.                     of certain OS/2 keystrokes.  You must delete this
  17321.                     statement if you want to use the default prompt.
  17322.  
  17323.             4NT     The 4DOS/NT default prompt is [$n] (drive name in
  17324.                     square brackets) on floppy drives, and [$p] (current
  17325.                     drive and directory in square brackets) on all other
  17326.                     drives.
  17327.  
  17328.                     If you enter PROMPT with no arguments, the prompt will
  17329.                     be reset to its default value.  The PROMPT command
  17330.                     sets the environment variable PROMPT, so to view the
  17331.                     current prompt setting use the command:
  17332.  
  17333.                          c:\> set prompt
  17334.  
  17335.                     (If the prompt is not set at all, the PROMPT
  17336.                     environment variable will not be used, in which case
  17337.                     the SET command above will give a "Not in environment"
  17338.                     error.)
  17339.  
  17340.                ##   Along with literal text, special characters, and ANSI
  17341.                     sequences (under DOS and OS/2), you can include the
  17342.                     text of any environment variable, internal variable,
  17343.                     or variable function (see pages 100 and 108) in a
  17344.                     prompt.  For example, if you want to include the
  17345.                     amount of free memory in the command prompt, plus the
  17346.                     current drive and directory, you could use this
  17347.                     command:
  17348.  
  17349.                          c:\> prompt (%%@dosmem[K]K) $p$g
  17350.                          (601K) c:\data>
  17351.  
  17352.                     Notice that the @DOSMEM function is shown with two
  17353.                     leading percent signs [%].  If you used only one
  17354.                     percent sign, the @DOSMEM function would be expanded
  17355.                     once when the PROMPT command was executed, instead of
  17356.                     every time the prompt is displayed.  As a result, the
  17357.                     amount of memory would never change from the value it
  17358.                     had when you entered the PROMPT command.  You can also
  17359.                     use back-quotes to delay expanding the variable
  17360.                     function until the prompt is displayed:
  17361.  
  17362.                          c:\> prompt `(%@dosmem[K]K) $p$g`
  17363.  
  17364.  
  17365.  
  17366.  
  17367.         -------------------------------------------------------------------
  17368.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 297
  17369.                                                                      PROMPT
  17370.         -------------------------------------------------------------------
  17371.  
  17372.  
  17373.           4DOS, ##  If you have an ANSI-compatible driver installed
  17374.           4OS2      under 4DOS, or are running 4OS2, you can include ANSI
  17375.                     escape sequences in the PROMPT text.  See your online
  17376.                     help for complete details on ANSI.  This example uses
  17377.                     ANSI sequences to set a prompt that displays the shell
  17378.                     level, date, time and path in color on the top line of
  17379.                     the screen (enter the command as one line):
  17380.  
  17381.                          c:\> prompt $e[s$e[1;1f$e[41;1;37m$e[K[$z] $d
  17382.                               Time: $t$h$h$h  Path: $p$e[u$e[0;32m$n$g
  17383.  
  17384.             4NT     You cannot use ANSI escape sequences in your prompt in
  17385.                     4DOS/NT, because Windows NT does not provide ANSI
  17386.                     support.
  17387.  
  17388.                ##   A few older batch files use the PROMPT command to
  17389.                     transmit ANSI.SYS control sequences to the screen (for
  17390.                     example, to redefine function keys).  This technique
  17391.                     will not work with 4DOS and 4OS2, because they don't
  17392.                     display a prompt within batch files; hence, the
  17393.                     characters in the PROMPT string are never sent to
  17394.                     ANSI.SYS.  To send ANSI sequences in 4DOS and 4OS2,
  17395.                     use the ECHO command, substituting an escape character
  17396.                     followed by an e for $e in the PROMPT string (see page
  17397.                     73 for more information on the escape character).
  17398.  
  17399.                ##   You may find it helpful to define a different prompt
  17400.                     in secondary shells, perhaps including $z in the
  17401.                     prompt to display the shell level.  To do so, place a
  17402.                     PROMPT command in your 4START file and use IF or IFF
  17403.                     statements to set the appropriate prompt for different
  17404.                     shells (for an example, see page 108).
  17405.  
  17406.  
  17407.  
  17408.  
  17409.  
  17410.  
  17411.  
  17412.  
  17413.  
  17414.  
  17415.  
  17416.  
  17417.  
  17418.  
  17419.  
  17420.  
  17421.  
  17422.  
  17423.         -------------------------------------------------------------------
  17424.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 298
  17425.                                                                       PUSHD
  17426.         -------------------------------------------------------------------
  17427.  
  17428.  
  17429.         PUSHD                                                         (New)
  17430.  
  17431.         Purpose:    Save the current disk drive and directory, optionally
  17432.                     changing to a new drive and directory.
  17433.  
  17434.         Format:     PUSHD [pathname]
  17435.  
  17436.                     pathname:  The name of the new default drive and
  17437.                     directory.
  17438.  
  17439.                     See also:  DIRS, POPD and Directory Changes on page
  17440.                       .                    44
  17441.  
  17442.         Usage:      PUSHD saves the current drive and directory on a "last
  17443.                     in, first out" directory stack.  The POPD command
  17444.                     returns to the last drive and directory that was saved
  17445.                     by PUSHD.  You can use these commands together to
  17446.                     change directories, perform some work, and return to
  17447.                     the starting drive and directory.  The DIRS command
  17448.                     displays the contents of the directory stack.
  17449.  
  17450.                     To save the current drive and directory, without
  17451.                     changing directories, use the PUSHD command by itself,
  17452.                     with no pathname.
  17453.  
  17454.                     If a pathname is specified as part of the PUSHD
  17455.                     command, the current drive and directory are saved and
  17456.                     PUSHD changes to the specified drive and directory.
  17457.                     If the pathname includes a drive letter, PUSHD changes
  17458.                     to the specified directory on the new drive without
  17459.                     changing the current directory on the original drive.
  17460.  
  17461.                     This example saves the current directory and changes
  17462.                     to C:\WORDP\MEMOS, then returns to the original
  17463.                     directory:
  17464.  
  17465.                          c:\> pushd \wordp\memos
  17466.                          c:\wordp\memos> popd
  17467.                          c:\>
  17468.  
  17469.                     Directory changes made with PUSHD are recorded for
  17470.                     display in the directory history window (see page 45).
  17471.  
  17472.                ##   The directory stack can hold up to 255 characters, or
  17473.                     about 10 to 20 entries (depending on the length of the
  17474.                     names).  If you exceed this limit, the oldest entry is
  17475.                     removed before adding a new entry.
  17476.  
  17477.  
  17478.  
  17479.  
  17480.         -------------------------------------------------------------------
  17481.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 299
  17482.                                                                       PUSHD
  17483.         -------------------------------------------------------------------
  17484.  
  17485.  
  17486.                ##   If PUSHD can't change directly to the specified
  17487.                     directory, it will look for the CDPATH variable.  See
  17488.                     page 44 for details on CDPATH.
  17489.  
  17490.  
  17491.  
  17492.  
  17493.  
  17494.  
  17495.  
  17496.  
  17497.  
  17498.  
  17499.  
  17500.  
  17501.  
  17502.  
  17503.  
  17504.  
  17505.  
  17506.  
  17507.  
  17508.  
  17509.  
  17510.  
  17511.  
  17512.  
  17513.  
  17514.  
  17515.  
  17516.  
  17517.  
  17518.  
  17519.  
  17520.  
  17521.  
  17522.  
  17523.  
  17524.  
  17525.  
  17526.  
  17527.  
  17528.  
  17529.  
  17530.  
  17531.  
  17532.  
  17533.  
  17534.  
  17535.  
  17536.  
  17537.         -------------------------------------------------------------------
  17538.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 300
  17539.                                                                        QUIT
  17540.         -------------------------------------------------------------------
  17541.  
  17542.  
  17543.         QUIT                                                          (New)
  17544.  
  17545.         Purpose:    Terminate the current batch file.
  17546.  
  17547.         Format:          [value]                    QUIT
  17548.  
  17549.                     value:  The exit code from 0 to 255 to return to the
  17550.                     command processor or to the previous batch file.
  17551.  
  17552.                     See also:  CANCEL.
  17553.  
  17554.         Usage:      QUIT provides a simple way to exit a batch file before
  17555.                     reaching the end of the file.  If you QUIT a batch
  17556.                     file called from another batch file, you will be
  17557.                     returned to the previous file at the line following
  17558.                     the original CALL.
  17559.  
  17560.                     This example batch file fragment checks to see if the
  17561.                     user entered "quit" and exits if true.
  17562.  
  17563.                          input  Enter your choice :  %%option
  17564.                          if  "%option" == "quit"  quit
  17565.  
  17566.                     QUIT only ends the current batch file.  To end all
  17567.                     batch file processing, use the CANCEL command.
  17568.  
  17569.                ##   If you specify a value, QUIT will set the ERRORLEVEL
  17570.                     or exit code (see the IF command, and the %? variable
  17571.                     on page 102) to that value.
  17572.  
  17573.                ##   You can also use QUIT to terminate an alias.  If you
  17574.                     QUIT an alias while inside a batch file, QUIT will end
  17575.                     both the alias and the batch file and return you to
  17576.                     the command prompt or to the calling batch file.
  17577.  
  17578.  
  17579.  
  17580.  
  17581.  
  17582.  
  17583.  
  17584.  
  17585.  
  17586.  
  17587.  
  17588.  
  17589.  
  17590.  
  17591.  
  17592.  
  17593.  
  17594.         -------------------------------------------------------------------
  17595.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 301
  17596.                                                                  RD / RMDIR
  17597.         -------------------------------------------------------------------
  17598.  
  17599.  
  17600.         RD / RMDIR                                               (Enhanced)
  17601.  
  17602.         Purpose:    Remove one or more subdirectories.
  17603.  
  17604.         Format:     RD [/S] pathname...
  17605.  
  17606.                          or
  17607.  
  17608.                     RMDIR [/S] pathname...
  17609.  
  17610.                     pathname:  The name of a subdirectory to remove.
  17611.  
  17612.             4NT     /S(ubdirectories)
  17613.  
  17614.                     See also:  MD.
  17615.  
  17616.         Selection:  Supports extended wildcards, ranges, multiple file
  17617.                     names, and include lists (see pages 59 - 67).
  17618.  
  17619.         Usage:      RD and RMDIR are synonyms.  You can use either one.
  17620.  
  17621.                     RD removes directories from the directory tree.  For
  17622.                     example, to remove the subdirectory MEMOS from the
  17623.                     subdirectory WP, you can use this command:
  17624.  
  17625.                          c:\> rd \wp\memos
  17626.  
  17627.                     Before using RD, you must delete all files and
  17628.                     subdirectories (and their files) in the pathname you
  17629.                     want to remove.  Remember to remove hidden and read-
  17630.                     only files as well as normal files (you can use DEL /Z
  17631.                     to delete hidden and read-only files).
  17632.  
  17633.                     You can use wildcards in the pathname.
  17634.  
  17635.                ##   You cannot remove the root directory, the current
  17636.                     directory (.), any directory above the current
  17637.                     directory in the directory tree, or any directory in
  17638.                     use by another process in a multitasking system.
  17639.  
  17640.         Options:    /S(ubdirectories):  This option is included only for
  17641.                     compatibility with Windows NT's CMD.EXE, and should be
  17642.           4NT ! ##  used with EXTREME CAUTION!  It deletes all files
  17643.                     (including hidden and system files) in the named
  17644.                     directory and all of its subdirectories, then removes
  17645.                     all empty subdirectories.  This option does not prompt
  17646.                     for permission before deleting files and
  17647.                     subdirectories, and can potentially erase all files on
  17648.                     a drive with a single command.
  17649.  
  17650.  
  17651.         -------------------------------------------------------------------
  17652.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 302
  17653.                                                                      REBOOT
  17654.         -------------------------------------------------------------------
  17655.  
  17656.  
  17657.         REBOOT                                                        (New)
  17658.  
  17659.         Purpose:    Do a warm or cold system reboot.
  17660.  
  17661.         Format:     REBOOT [/C /L /S /V]
  17662.  
  17663.                     /C(old reboot)           /S(hutdown)
  17664.                     /L(ogoff)                /V(erify)
  17665.  
  17666.         ##  Usage:  REBOOT will completely restart your computer.  It
  17667.                     normally performs a warm reboot, which is comparable
  17668.                     to pressing Ctrl-Alt-Delete under DOS or OS/2, or to a
  17669.                     shutdown and restart under Windows NT.  Under DOS,
  17670.                     REBOOT can also perform a cold reboot, which is
  17671.                     comparable to turning the power off and back on or
  17672.                     pressing the reset button.  A reboot is necessary to
  17673.                     activate any changes to your CONFIG.SYS file in DOS
  17674.                     and OS/2, and may also be used if you wish to restart
  17675.                     DOS with an altered 4START or AUTOEXEC.BAT file.
  17676.  
  17677.                     The following example prompts you to verify the
  17678.                     reboot, then does a warm boot:
  17679.  
  17680.                          c:\> reboot /v
  17681.  
  17682.                     REBOOT defaults to performing a warm boot, with no
  17683.                     prompting.
  17684.  
  17685.                     REBOOT flushes the disk buffers, resets the drives,
  17686.                     and waits one second before rebooting, to allow disk
  17687.                     caching programs to finish writing any cached data.
  17688.                     4OS2 and 4DOS/NT issue the proper commands to shut
  17689.                     down the operating system before rebooting.
  17690.  
  17691.         4DOS  !     Under DOS, some system BIOSes, memory managers,
  17692.                     multitaskers, or memory-resident programs (TSRs) may
  17693.                     intercept attempts to reboot your system and defeat
  17694.                     them entirely, convert a cold boot request to a warm
  17695.                     boot or vice versa, or in very rare cases, hang the
  17696.                     system - requiring a reboot!  As a result you may need
  17697.                     to experiment with which reboot options work best for
  17698.                     your system hardware and software configuration, and
  17699.                     under rare circumstances REBOOT may not be usable on
  17700.                     your system.
  17701.  
  17702.         4OS2  ! ##  Under OS/2, REBOOT must use the DOS.SYS device
  17703.                     driver to reboot your system.  DOS.SYS is loaded via a
  17704.                     DEVICE= statement in your CONFIG.SYS file.  If DOS.SYS
  17705.                     is not loaded, REBOOT will not work.
  17706.  
  17707.  
  17708.         -------------------------------------------------------------------
  17709.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 303
  17710.                                                                      REBOOT
  17711.         -------------------------------------------------------------------
  17712.  
  17713.  
  17714.         Options:    /C(old):  Do a "cold" reboot.  This is similar to
  17715.                     turning the power off and back on, and may be
  17716.                     necessary to properly initialize the system.
  17717.             4DOS    REBOOT /C may not physically reset all hardware
  17718.                     devices as thoroughly as actually turning off the
  17719.                     power; its effect depends on the internal design of
  17720.                     each hardware device and on your system configuration.
  17721.  
  17722.             4NT     /L(ogoff):  Log off Windows NT, but do not reboot.
  17723.                     This option is equivalent to Logoff choice on the
  17724.                     Program Manager's File menu in Windows NT.
  17725.  
  17726.             4OS2,   /S(hutdown):  Shut down the system, but do not reboot.
  17727.             4NT     This option is equivalent to clicking the "Shutdown"
  17728.                     choice on the OS/2 2.x Workplace Shell popup menu, or
  17729.                     using the Shutdown choice on the Program Manager's
  17730.                     File menu in Windows NT.
  17731.  
  17732.                     /V(erify):  Prompt for confirmation (Y or N) before
  17733.                     rebooting or taking the action specified by other
  17734.                     REBOOT options.
  17735.  
  17736.  
  17737.  
  17738.  
  17739.  
  17740.  
  17741.  
  17742.  
  17743.  
  17744.  
  17745.  
  17746.  
  17747.  
  17748.  
  17749.  
  17750.  
  17751.  
  17752.  
  17753.  
  17754.  
  17755.  
  17756.  
  17757.  
  17758.  
  17759.  
  17760.  
  17761.  
  17762.  
  17763.  
  17764.  
  17765.         -------------------------------------------------------------------
  17766.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 304
  17767.                                                                         REM
  17768.         -------------------------------------------------------------------
  17769.  
  17770.  
  17771.         REM                                                    (Compatible)
  17772.  
  17773.         Purpose:    Put a comment in a batch file.
  17774.  
  17775.         Format:     REM [comment]
  17776.  
  17777.                     comment:  The text to include in the batch file.
  17778.  
  17779.         Usage:      The REM command lets you place a remark or comment in
  17780.                     a batch file.  Batch file comments are useful for
  17781.                     documenting the purpose of a batch file and the
  17782.                     procedures you have used.  For example:
  17783.  
  17784.                          rem This batch file provides a
  17785.                          rem menu-based system for accessing
  17786.                          rem word processing utilities.
  17787.                          rem
  17788.                          rem Clear the screen and get selection
  17789.                          cls
  17790.  
  17791.                     REM must be followed by a space or tab character and
  17792.                     then your comment.  Comments can be up to 255
  17793.                     characters long in 4DOS, or 1023 characters long in
  17794.                     4OS2 and 4DOS/NT.  4DOS, 4OS2, and 4DOS/NT will
  17795.                     normally ignore everything on the line after the REM
  17796.                     command, including quote characters, redirection
  17797.                     symbols, and other commands (see below for the
  17798.                     exception to this rule).
  17799.  
  17800.                     If ECHO is ON, the comment is displayed.  Otherwise,
  17801.                     it is ignored.  If ECHO is ON and you don't want to
  17802.                     display the line, preface the REM command with an at
  17803.                     sign [@].
  17804.  
  17805.                ##   You can use REM to create a zero-byte file if you use
  17806.                     a redirection symbol immediately after the REM
  17807.                     command.  For example, to create the zero-byte file
  17808.                     C:\FOO:
  17809.  
  17810.                          c:\> rem>foo
  17811.  
  17812.                     (This capability is included for compatibility with
  17813.                     COMMAND.COM and CMD.EXE.  A simpler method for
  17814.                     creating a zero-byte file with 4DOS, 4OS2, or 4DOS/NT
  17815.                     is to enter  >filename as a command, with no actual
  17816.                     command before the [>] redirection character.)
  17817.  
  17818.  
  17819.  
  17820.  
  17821.  
  17822.         -------------------------------------------------------------------
  17823.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 305
  17824.                                                                REN / RENAME
  17825.         -------------------------------------------------------------------
  17826.  
  17827.  
  17828.         REN / RENAME                                             (Enhanced)
  17829.  
  17830.         Purpose:    Rename files or subdirectories.
  17831.  
  17832.         Format:     REN [/A[[:][-]rhsda] /N /P /Q /S /T] old_name...
  17833.                     new_name
  17834.  
  17835.                          or
  17836.  
  17837.                     RENAME [/A[[:][-]rhsda] /N /P /Q /S /T] old_name...
  17838.                     new_name
  17839.  
  17840.                     old_name:  Original name of the file(s) or
  17841.                     subdirectory.
  17842.                     new_name:  New name to use, or new path on the same
  17843.                     drive.
  17844.  
  17845.                     /A(ttribute select)      /Q(uiet)
  17846.                     /N(othing)               /S(ubdirectory)
  17847.                     /P(rompt)                /T(otal)
  17848.  
  17849.                      See also:  COPY and MOVE.
  17850.  
  17851.         Selection:  Supports extended wildcards, ranges, multiple file
  17852.                     names, and include lists (see pages 59 - 67).
  17853.  
  17854.         Usage:      REN and RENAME are synonyms.  You may use either one.
  17855.  
  17856.                     REN lets you change the name of a file or a
  17857.                     subdirectory, or move one or more files to a new
  17858.                     subdirectory on the same drive.  (If you want to move
  17859.                     files to a different drive, use MOVE.)
  17860.  
  17861.                     In its simplest form, you simply give REN the old_name
  17862.                     of an existing file or subdirectory and then a
  17863.                     new_name.  The new_name must not already exist - you
  17864.                     can't give two files the same name (unless they are in
  17865.                     different directories).  The first example renames the
  17866.                     file MEMO.TXT to MEM.TXT.  The second example changes
  17867.                     the name of the \WORD directory to \WP:
  17868.  
  17869.                          c:\> rename memo.txt mem.txt
  17870.                          c:\> rename \word \wp
  17871.  
  17872.                     You can also use REN to rename a group of files that
  17873.                     you specify with wildcards, as multiple files, or in
  17874.                     an include list.  When you do, the new_name must use
  17875.                     one or more wildcards to show what part of each
  17876.                     filename to change.  Both of the next two examples
  17877.                     change the extensions of multiple files to .SAV:
  17878.  
  17879.         -------------------------------------------------------------------
  17880.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 306
  17881.                                                                REN / RENAME
  17882.         -------------------------------------------------------------------
  17883.  
  17884.  
  17885.                          c:\> ren config.sys autoexec.bat 4start.btm *.sav
  17886.                          c:\> ren *.txt *.sav
  17887.  
  17888.                     REN can move files to a different subdirectory on the
  17889.                     same drive.  When it is used for this purpose, REN
  17890.                     requires one or more filenames for the old_name and a
  17891.                     directory name for the new_name:
  17892.  
  17893.                          c:\> ren memo.txt \wp\memos\
  17894.                          c:\> ren oct.dat nov.dat \data\save\
  17895.  
  17896.                     The final backslash in the last two examples is
  17897.                     optional.  If you use it, you force REN to recognize
  17898.                     the last argument as the name of a directory, not a
  17899.                     file.  The advantage of this approach is that if you
  17900.                     accidentally mistype the directory name, REN will
  17901.                     report an error instead of renaming your files in a
  17902.                     way that you didn't intend.
  17903.  
  17904.                     Finally, REN can move files to a new directory and
  17905.                     change their name at the same time if you specify both
  17906.                     a path and file name for new_name.  In this example,
  17907.                     the files are renamed with an extension of .SAV as
  17908.                     they are moved to a new directory:
  17909.  
  17910.                          c:\> ren *.dat \data\save\*.sav
  17911.  
  17912.                     When new_name refers to a file or files (rather than a
  17913.                     directory), the file(s) must not already exist.  Also,
  17914.                     you cannot rename a subdirectory to a new location on
  17915.                     the directory tree.
  17916.  
  17917.                ##   REN does not change a file's attributes.  The new_name
  17918.                     file(s) will have the same attributes as old_name.
  17919.  
  17920.         Options: ## /A(ttribute select): Rename only those files that have
  17921.                     the specified attribute(s) set.  Preceding the
  17922.                     attribute character with a hyphen [-] will select
  17923.                     files that do not have that attribute set.  The
  17924.                     attributes are:
  17925.  
  17926.                          R    Read-only         D    Subdirectory
  17927.                          H    Hidden            A    Archive
  17928.                          S    System
  17929.  
  17930.                     If no attributes are listed at all (e.g., REN /A ...),
  17931.                     REN will rename all files and subdirectories including
  17932.                     hidden and system files.  If attributes are combined,
  17933.                     all the specified attributes must match for a file to
  17934.                     be selected.  For example, /A:RHS will select only
  17935.  
  17936.         -------------------------------------------------------------------
  17937.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 307
  17938.                                                                REN / RENAME
  17939.         -------------------------------------------------------------------
  17940.  
  17941.  
  17942.                     those files with all three attributes set.  See page
  17943.                     18 for more information on file attributes.
  17944.  
  17945.                     /N(othing):  Do everything except actually rename the
  17946.                     file(s).  This option is useful for testing what a REN
  17947.                     command will actually do.
  17948.  
  17949.                     /P(rompt):  Prompt the user to confirm each rename
  17950.                     operation.  Your options at the prompt are explained
  17951.                     in detail on page 50.
  17952.  
  17953.                     /Q(uiet):  Don't display filenames  or the number of
  17954.                     files renamed.  This option is most often used in
  17955.                     batch files.  See also /T.
  17956.  
  17957.                     /S(ubdirectory):  Normally, you can rename a
  17958.                     subdirectory only if you do not use any wildcards in
  17959.                     the new_name.  This prevents subdirectories from being
  17960.                     renamed inadvertently when a group of files is being
  17961.                     renamed with wildcards.  /S will let you rename a
  17962.                     subdirectory even when you use wildcards.
  17963.  
  17964.                     /T(otal):  Don't display filenames as they are
  17965.                     renamed, but report the number of files renamed.  See
  17966.                     also /Q.
  17967.  
  17968.  
  17969.  
  17970.  
  17971.  
  17972.  
  17973.  
  17974.  
  17975.  
  17976.  
  17977.  
  17978.  
  17979.  
  17980.  
  17981.  
  17982.  
  17983.  
  17984.  
  17985.  
  17986.  
  17987.  
  17988.  
  17989.  
  17990.  
  17991.  
  17992.  
  17993.         -------------------------------------------------------------------
  17994.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 308
  17995.                                                                      RETURN
  17996.         -------------------------------------------------------------------
  17997.  
  17998.  
  17999.         RETURN                                                        (New)
  18000.  
  18001.         Purpose:    Return from a GOSUB (subroutine) in a batch file.
  18002.  
  18003.         Format:     RETURN
  18004.  
  18005.                     See also:  GOSUB.
  18006.  
  18007.         Usage:      4DOS, 4OS2, and 4DOS/NT allow subroutines in batch
  18008.                     files.
  18009.  
  18010.                     A subroutine begins with a label (a colon followed by
  18011.                     a word) and ends with a RETURN command.
  18012.  
  18013.                     The subroutine is invoked with a GOSUB command from
  18014.                     another part of the batch file.  When a RETURN command
  18015.                     is encountered the subroutine terminates, and
  18016.                     execution of the batch file continues on the line
  18017.                     following the original GOSUB.
  18018.  
  18019.                     The following batch file fragment calls a subroutine
  18020.                     which displays the files in the current directory:
  18021.  
  18022.                          echo Calling a subroutine
  18023.                          gosub subr1
  18024.                          echo Returned from the subroutine
  18025.                          quit
  18026.  
  18027.                          :subr1
  18028.                          dir /a/w
  18029.                          return
  18030.  
  18031.  
  18032.  
  18033.  
  18034.  
  18035.  
  18036.  
  18037.  
  18038.  
  18039.  
  18040.  
  18041.  
  18042.  
  18043.  
  18044.  
  18045.  
  18046.  
  18047.  
  18048.  
  18049.  
  18050.         -------------------------------------------------------------------
  18051.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 309
  18052.                                                                      SCREEN
  18053.         -------------------------------------------------------------------
  18054.  
  18055.  
  18056.         SCREEN                                                        (New)
  18057.  
  18058.         Purpose:    Position the cursor on the screen and optionally
  18059.                     display a message.
  18060.  
  18061.         Format:     SCREEN row column [text]
  18062.  
  18063.                     row:  The new row location for the cursor.
  18064.                     column:  The new column location for the cursor.
  18065.                     text:  Optional text to display at the new cursor
  18066.                     location.
  18067.  
  18068.                     See also:  ECHO, SCRPUT, TEXT, and VSCRPUT.
  18069.  
  18070.         Usage:      SCREEN allows you to create attractive screen displays
  18071.                     in batch files.  You use it to specify where a message
  18072.                     will appear on the screen.  You can use SCREEN to
  18073.                     create menu displays, logos, etc.  The following batch
  18074.                     file fragment displays a menu:
  18075.  
  18076.                          @echo off
  18077.                          cls
  18078.                          screen 3 10  Select a number from 1 to 4:
  18079.                          screen 6 20  1 - Word Processing
  18080.                          screen 7 20  2 - Spreadsheet
  18081.                          screen 8 20  3 - Telecommunications
  18082.                          screen 9 20  4 - Quit
  18083.  
  18084.                     SCREEN does not change the screen colors.  If you have
  18085.                     ANSI.SYS installed and have set colors with CLS or
  18086.                     COLOR, those colors will be used for the display.  To
  18087.                     display text in specific colors, use SCRPUT or
  18088.                     VSCRPUT.  SCREEN always leaves the cursor at the end
  18089.                     of the displayed text.
  18090.  
  18091.                     The row and column values are zero-based, so on a
  18092.                     standard 25 line by 80 column display, valid rows are
  18093.                     0 - 24 and valid columns are 0 - 79.  You can also
  18094.                     specify the row and column as offsets from the current
  18095.                     cursor position.  Begin the value with a plus sign [+]
  18096.                     to move the cursor down the specified number of rows
  18097.                     or to the right the specified number of columns, or
  18098.                     with a minus sign [-] to move the cursor up or to the
  18099.                     left.  This example prints a string 3 lines above the
  18100.                     current position, in absolute column 10:
  18101.  
  18102.                          screen -3 10 Hello, World!
  18103.  
  18104.  
  18105.  
  18106.  
  18107.         -------------------------------------------------------------------
  18108.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 310
  18109.                                                                      SCREEN
  18110.         -------------------------------------------------------------------
  18111.  
  18112.  
  18113.                     SCREEN checks for a valid row and column, and displays
  18114.                     a "Usage" error message if either value is out of
  18115.                     range.
  18116.  
  18117.  
  18118.  
  18119.  
  18120.  
  18121.  
  18122.  
  18123.  
  18124.  
  18125.  
  18126.  
  18127.  
  18128.  
  18129.  
  18130.  
  18131.  
  18132.  
  18133.  
  18134.  
  18135.  
  18136.  
  18137.  
  18138.  
  18139.  
  18140.  
  18141.  
  18142.  
  18143.  
  18144.  
  18145.  
  18146.  
  18147.  
  18148.  
  18149.  
  18150.  
  18151.  
  18152.  
  18153.  
  18154.  
  18155.  
  18156.  
  18157.  
  18158.  
  18159.  
  18160.  
  18161.  
  18162.  
  18163.  
  18164.         -------------------------------------------------------------------
  18165.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 311
  18166.                                                                      SCRPUT
  18167.         -------------------------------------------------------------------
  18168.  
  18169.  
  18170.         SCRPUT                                                        (New)
  18171.  
  18172.         Purpose:    Position text on the screen and display it in color.
  18173.  
  18174.         Format:     SCRPUT row col [BRIght] [BLInk] fg ON [BRIght] bg text
  18175.  
  18176.                     row:  Starting row
  18177.                     col:  Starting column
  18178.                     fg:  Foreground character color
  18179.                     bg:  Background character color
  18180.                     text:  The text to display
  18181.  
  18182.                     See also:  CLS, ECHO, SCREEN, TEXT, and VSCRPUT.
  18183.  
  18184.         Usage:      SCRPUT allows you to create attractive screen displays
  18185.                     in batch files.  You use it to specify where a message
  18186.                     will appear on the screen and what colors will be used
  18187.                     to display the message text.  You can use SCRPUT to
  18188.                     create menu displays, logos, etc.
  18189.  
  18190.                     SCRPUT works like SCREEN, but allows you to specify
  18191.                     the display colors.  It writes directly to the screen
  18192.                     and does not require ANSI support.  It always leaves
  18193.                     the cursor in its current position.  See page 26 for
  18194.                     details about colors and color names, and notes on the
  18195.                     use of bright background colors.
  18196.  
  18197.                     The row and column are zero-based, so on a standard 25
  18198.                     line by 80 column display, valid rows are 0 - 24 and
  18199.                     valid columns are 0 - 79.  You can also specify the
  18200.                     row and column as offsets from the current cursor
  18201.                     position.  Begin the value with a plus sign [+] to
  18202.                     move down the specified number of rows or to the right
  18203.                     the specified number of columns, or with a minus sign
  18204.                     [-] to move up or to the left.
  18205.  
  18206.                     The following batch file fragment displays a menu in
  18207.                     color:
  18208.  
  18209.                          cls white on blue
  18210.                          scrput 3 10 bri whi on blu Select an option:
  18211.                          scrput 6 20 bri red on blu 1 - Word Processing
  18212.                          scrput 7 20 bri yel on blu 2 - Spreadsheet
  18213.                          scrput 8 20 bri gre on blu 3 - Communications
  18214.                          scrput 9 20 bri mag on blu 4 - Quit
  18215.  
  18216.             4DOS ## If you have an unusual display adapter which does not
  18217.                     support the direct video output used by SCRPUT, see
  18218.                     the OutputBIOS directive on page 150.
  18219.  
  18220.  
  18221.         -------------------------------------------------------------------
  18222.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 312
  18223.                                                                      SELECT
  18224.         -------------------------------------------------------------------
  18225.  
  18226.  
  18227.         SELECT                                                        (New)
  18228.  
  18229.         Purpose:    Interactively select files for a command.
  18230.  
  18231.         Format:     SELECT [/A[:][-]rhsda /C[HP] /D /E /H /I"text"
  18232.                          /O[:][-]acdeginrsu /Z] [command]... (files...)...
  18233.  
  18234.                     command:  The command to execute with the selected
  18235.                     files.
  18236.                     files:  The files from which to select.  File names
  18237.                     may be enclosed in either parentheses or square
  18238.                     brackets.  The difference is explained below.
  18239.  
  18240.                     /A(ttribute select)      /H(ide dots)
  18241.                     /C[HP] (Compression)     /I  (match descriptions)
  18242.                     /D(isable color coding)  /O(rder)
  18243.                     /E  (use upper case)     /Z  (use FAT format)
  18244.  
  18245.         Selection:  Supports extended wildcards, ranges, multiple file
  18246.                     names, and include lists (see pages 59 - 67).  Date,
  18247.                     time, or size ranges must appear immediately after the
  18248.                     SELECT keyword.
  18249.  
  18250.         Usage:      SELECT allows you to select files for internal and
  18251.                     external commands by using a full-screen "point and
  18252.                     shoot" display.  You can have SELECT execute a command
  18253.                     once for each file you select, or have it create a
  18254.                     list of files for a command to work with.  The command
  18255.                     can be an internal command, an alias, an external
  18256.                     command, or a batch file.
  18257.  
  18258.                     If you use parentheses around the files, SELECT
  18259.                     executes the command once for each file you have
  18260.                     selected.  During each execution, one of the selected
  18261.                     files is passed to the command as an argument.  If you
  18262.                     use square brackets around files, the SELECTed files
  18263.                     are combined into a single list, separated by spaces.
  18264.                     The command is then executed once with the entire list
  18265.                     presented as its command-line arguments.
  18266.  
  18267.                     SELECT uses the cursor up, cursor down, PgUp, and PgDn
  18268.                     keys to scroll through the file list.
  18269.  
  18270.                     Press the L key to view the current highlighted file
  18271.                     with LIST.  When you exit from LIST, the SELECT screen
  18272.                     will be restored.
  18273.  
  18274.                     Use the + key or the spacebar to select a file (or
  18275.                     unselect a marked file), and the - key to unselect a
  18276.                     file.  The * key will reverse all of the current marks
  18277.  
  18278.         -------------------------------------------------------------------
  18279.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 313
  18280.                                                                      SELECT
  18281.         -------------------------------------------------------------------
  18282.  
  18283.  
  18284.                     (excluding subdirectories), and the / key will unmark
  18285.                     everything.  After marking the files, press Enter to
  18286.                     execute the command.
  18287.  
  18288.                     You can select a single file by moving the scroll bar
  18289.                     to the filename and pressing Enter without marking any
  18290.                     other files.
  18291.  
  18292.                     To skip the files listed in the current display and go
  18293.                     on to the next file specification inside the
  18294.                     parentheses or brackets (if any), press the Esc key.
  18295.                     To cancel the current SELECT command entirely, press
  18296.                     Ctrl-C or Ctrl-Break.
  18297.  
  18298.                     In the simplest form of SELECT, you merely specify the
  18299.                     command and then the list of files from which you will
  18300.                     make your selection(s).  For example:
  18301.  
  18302.                          c:\> select copy (*.com *.exe) a:\
  18303.  
  18304.                     will let you select from among the .COM and .EXE files
  18305.                     on the current drive.  It will then invoke the COPY
  18306.                     command to copy each file you select to drive A:.  You
  18307.                     will be able to select first from a list of all .COM
  18308.                     files in the current directory, and then from a list
  18309.                     of all .EXE files.
  18310.  
  18311.                     If you want to select from a list of all the .COM and
  18312.                     .EXE files mixed together, create an include list
  18313.                     inside the parentheses by inserting a semicolon (see
  18314.                     page 67 for information on include lists):
  18315.  
  18316.                          c:\> select copy (*.com;*.exe) a:\
  18317.  
  18318.                     Finally, if you want the SELECT command to send a
  18319.                     single list of files to COPY, instead of invoking COPY
  18320.                     once for each file you select, put the file names in
  18321.                     square brackets instead of parentheses:
  18322.  
  18323.                          c:\> select copy [*.com;*.exe] a:\
  18324.  
  18325.                     If you use brackets, you have to be sure that the
  18326.                     resulting command (the word COPY, the list of files,
  18327.                     and the destination drive in this example) is no more
  18328.                     than 255 characters long for internal commands and no
  18329.                     more than 127 characters long for external commands
  18330.                     under 4DOS.  The line length limit for 4OS2 and
  18331.                     4DOS/NT is 1,023 characters for both internal and
  18332.                     external commands.  The current line length is
  18333.  
  18334.  
  18335.         -------------------------------------------------------------------
  18336.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 314
  18337.                                                                      SELECT
  18338.         -------------------------------------------------------------------
  18339.  
  18340.  
  18341.                     displayed by SELECT while you are marking files to
  18342.                     help you to conform to these limits.
  18343.  
  18344.                     The parentheses or brackets enclosing the file name(s)
  18345.                     can appear anywhere within the command; SELECT assumes
  18346.                     that the first set of parentheses or brackets it finds
  18347.                     is the one containing the list of files from which you
  18348.                     wish to make your selection.
  18349.  
  18350.                     The list of files from which you wish to select can be
  18351.                     further refined by using date, time, and size ranges
  18352.                     (see page 62).  The range must be placed immediately
  18353.                     after the word SELECT.  If the command is an internal
  18354.                     command that supports ranges, an independent range can
  18355.                     also be used in the command itself.
  18356.  
  18357.                ##   If you don't specify a command, the selected
  18358.                     filename(s) will become the command.  For example,
  18359.                     this command defines an alias called UTILS that
  18360.                     selects from the executable files in the directory
  18361.                     C:\UTIL, and then executes them in the order marked
  18362.                     (enter the alias on one line):
  18363.  
  18364.                          c:\> alias utils select
  18365.                                (c:\util\*.com;*.exe;*.btm;*.bat)
  18366.  
  18367.                ##   If you want to use filename completion (see page 41)
  18368.                     to enter the filenames inside the parentheses, type a
  18369.                     space after the opening parenthesis.  Otherwise the
  18370.                     command-line editor will treat the open parenthesis as
  18371.                     the first character of the filename.
  18372.  
  18373.                ##   You can set the default colors used by SELECT with the
  18374.                     SelectColors and SelectStatBarColors directives in the
  18375.                     .INI file (see page 141).  If SelectColors is not
  18376.                     used, the SELECT display will use the current default
  18377.                     colors.  If SelectStatBarColors is not used, the
  18378.                     status bar will use the reverse of the SELECT display
  18379.                     colors.
  18380.  
  18381.                     You can display the filenames in color by setting the
  18382.                     COLORDIR environment variable or using the ColorDir
  18383.                     directive in your .INI file.  See page 30 for details.
  18384.                     To disable directory color coding within SELECT, use
  18385.                     the /D option.
  18386.  
  18387.                     When displaying descriptions, SELECT adds a right
  18388.                     arrow at the end of the line if the description is too
  18389.                     long to fit on the screen.  This symbol will alert you
  18390.                     to the existence of additional description text.
  18391.  
  18392.         -------------------------------------------------------------------
  18393.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 315
  18394.                                                                      SELECT
  18395.         -------------------------------------------------------------------
  18396.  
  18397.  
  18398.                     You can use the left and right arrow keys to scroll
  18399.                     the screen horizontally and view the additional text.
  18400.  
  18401.                ##   With the /I option, you can select files based on
  18402.                     their descriptions.  SELECT will display files if
  18403.                     their description matches the text after the /I
  18404.                     switch.  The search is not case sensitive.  You can
  18405.                     use wildcards and extended wild cards as part of the
  18406.                     text.
  18407.  
  18408.                ##   When sorting file names and extensions for the SELECT
  18409.                     display, 4DOS, 4OS2, and 4DOS/NT normally assume that
  18410.                     sequences of digits should be sorted numerically (for
  18411.                     example, the file DRAW2 would come before DRAW03
  18412.                     because 2 is numerically smaller than 03), rather than
  18413.                     strictly alphabetically (where DRAW2 would come second
  18414.                     because "2" comes after "0").  You can defeat this
  18415.                     behavior and force a strict alphabetic sort with the
  18416.                     /O:a option.
  18417.  
  18418.         4DOS  ##    SELECT normally writes text directly to the screen.
  18419.                     If you have an unusual display adapter which does not
  18420.                     support direct video output, see the OutputBIOS
  18421.                     directive on page 150.
  18422.  
  18423.         4DOS ## !   If you receive a stack overflow error when using
  18424.                     SELECT in complex, nested command sequences, see the
  18425.                     notes under the StackSize directive on page 150.
  18426.  
  18427.         Options: ## /A(ttribute select):  Display only those files that
  18428.                     have the specified attribute set.  Preceding the
  18429.                     attribute character with a minus [-] will display
  18430.                     files that do not have that attribute set.  Attributes
  18431.                     can also be combined.  The attributes are:
  18432.  
  18433.                          R    Read-only         D    Subdirectory
  18434.                          H    Hidden            A    Archive
  18435.                          S    System
  18436.  
  18437.                     If no attributes are listed at all (e.g., SELECT /A
  18438.                     ...), SELECT will display all files and subdirectories
  18439.                     including hidden and system files.  If attributes are
  18440.                     combined, all the specified attributes must match for
  18441.                     a file to be included in the listing.  For example,
  18442.                     /A:RHS will display only those files with all three
  18443.                     attributes set.  See page 18 for more information on
  18444.                     file attributes.
  18445.  
  18446.             4DOS    /C(ompression):  Display compression ratios on
  18447.                     compressed drives.  The compression ratio is displayed
  18448.  
  18449.         -------------------------------------------------------------------
  18450.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 316
  18451.                                                                      SELECT
  18452.         -------------------------------------------------------------------
  18453.  
  18454.  
  18455.                     instead of the file description.  The ratio is left
  18456.                     blank for directories, for files with a length of 0
  18457.                     bytes, and for files on non-compressed drives.  See
  18458.                     APPNOTES.DOC for a list of supported compression
  18459.                     systems.
  18460.  
  18461.                     Using /CH displays compression ratios like /C, but
  18462.                     bases the calculation on the host drive's cluster
  18463.                     size.  This gives a more accurate picture of the space
  18464.                     saved through compression than is given by /C.
  18465.  
  18466.                     If /CP is used instead of /C, the compression is
  18467.                     displayed as a percentage instead of a ratio.  If /CHP
  18468.                     is used instead of /CH, the host compression is
  18469.                     displayed as a percentage.  The /CHP option must be
  18470.                     entered as shown; you can not use /CPH.
  18471.  
  18472.                     See the DIR /C documentation on page 209 for more
  18473.                     details on how compression ratios are calculated.
  18474.  
  18475.                ##   /D(isable color coding):  Temporarily turn off
  18476.                     directory color coding within SELECT.
  18477.  
  18478.                     /E  (use upper case):  Display filenames in the
  18479.                     traditional upper case format; also see SETDOS /U and
  18480.                     the UpperCase directive in the .INI file.
  18481.  
  18482.                     /H(ide dots):  Suppress the display of the "." and
  18483.                     ".." directories.
  18484.  
  18485.                     /I (match descriptions):  Display filenames by
  18486.                     matching text in their descriptions.  The text can
  18487.                     include wild cards and extended wildcards.  The search
  18488.                     text must be enclosed in quotation marks.  /I will be
  18489.                     ignored if /C or /O:c is also used.
  18490.  
  18491.                     /O(rder):  Set the sort order for the files.  The
  18492.                     order can be any combination of the following options:
  18493.  
  18494.                          -    Reverse the sort order for the next option
  18495.                          a    Sort names and extensions in standard ASCII
  18496.                               order, rather than sorting numerically when
  18497.                               digits are included in the name or extension
  18498.                          c    Sort by compression ratio (the least
  18499.                               compressed file in the list will be
  18500.                               displayed first).  The compression ratios
  18501.                               will be used as the basis of the sort and
  18502.                               will also be displayed.  If /O:c is used
  18503.                               with /CH or /CHP, the sort will be based on
  18504.                               the host-drive compression ratios.
  18505.  
  18506.         -------------------------------------------------------------------
  18507.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 317
  18508.                                                                      SELECT
  18509.         -------------------------------------------------------------------
  18510.  
  18511.  
  18512.                          d    Sort by date and time (oldest first)
  18513.                          e    Sort by extension
  18514.                          g    Group subdirectories together
  18515.                          i    Sort by the file description (ignored if /C
  18516.                               or /O:c is also used)
  18517.                          n    Sort by filename (this is the default)
  18518.                          r    Reverse the sort order for all options
  18519.                          s    Sort by size
  18520.                          u    Unsorted
  18521.  
  18522.             4OS2,   /Z:  Display HPFS and NTFS filenames in FAT format.
  18523.             4NT     Long names will be truncated to 12 characters.  If
  18524.                     the name is longer than 12 characters, it will be
  18525.                     followed by a right arrow to show that one or more
  18526.                     characters have been truncated.
  18527.  
  18528.  
  18529.  
  18530.  
  18531.  
  18532.  
  18533.  
  18534.  
  18535.  
  18536.  
  18537.  
  18538.  
  18539.  
  18540.  
  18541.  
  18542.  
  18543.  
  18544.  
  18545.  
  18546.  
  18547.  
  18548.  
  18549.  
  18550.  
  18551.  
  18552.  
  18553.  
  18554.  
  18555.  
  18556.  
  18557.  
  18558.  
  18559.  
  18560.  
  18561.  
  18562.         -------------------------------------------------------------------
  18563.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 318
  18564.                                                                         SET
  18565.         -------------------------------------------------------------------
  18566.  
  18567.  
  18568.         SET                                                      (Enhanced)
  18569.  
  18570.         Purpose:    Display, create, modify, or delete environment
  18571.                     variables.
  18572.  
  18573.         Format:     SET [/M /P /R filename...] [name[=][value]]
  18574.  
  18575.                     filename:  The name of a file containing variable
  18576.                     definitions.
  18577.                     name:  The name of the environment variable to define
  18578.                     or modify.
  18579.                     value:  The new value for the variable.
  18580.  
  18581.                     /M(aster)                   /R(ead from file)
  18582.                     /P(ause)
  18583.  
  18584.                     See also:  ESET and UNSET.
  18585.  
  18586.         Usage:      Every program and command inherits an environment,
  18587.                     which is a list of variable names, each of which is
  18588.                     followed by an equal sign and some text.  Many
  18589.                     programs use entries in the environment to modify
  18590.                     their own actions.  4DOS, 4OS2, and 4DOS/NT use
  18591.                     several environment variables (see page 98).  See
  18592.                     pages 21 and 96 for more information on the
  18593.                     environment.
  18594.  
  18595.                     If you simply type the SET command with no options or
  18596.                     arguments, it will display all the names and values
  18597.                     currently stored in the environment.  Typically, you
  18598.                     will see an entry called COMSPEC, an entry called
  18599.                     PATH, an entry called CMDLINE, and whatever other
  18600.                     environment variables you and your programs have
  18601.                     established:
  18602.  
  18603.                          c:\> set
  18604.                          COMSPEC=C:\4DOS.COM
  18605.                          PATH=C:\;C:\DOS;C:\UTIL
  18606.                          CMDLINE=E:\UTIL\MAPMEM.EXE
  18607.  
  18608.                     To add a variable to the environment, type SET, a
  18609.                     space, the variable name, an equal sign, and the text:
  18610.  
  18611.                          c:\> set mine=c:\finance\myfiles
  18612.  
  18613.                     The variable name is converted to upper case by 4DOS
  18614.                     and 4OS2 (for compatibility with CMD.EXE, 4DOS/NT does
  18615.                     not shift variable names to upper case).  The text
  18616.                     after the equal sign will be left just as you entered
  18617.  
  18618.  
  18619.         -------------------------------------------------------------------
  18620.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 319
  18621.                                                                         SET
  18622.         -------------------------------------------------------------------
  18623.  
  18624.  
  18625.                     it.  If the variable already exists, its value will be
  18626.                     replaced with the new text that you entered.
  18627.  
  18628.                !    Normally you should not put a space on either side of
  18629.                     the equal sign.  A space before the equal sign will
  18630.                     become part of the name; a space after the equal sign
  18631.                     will become part of the value.
  18632.  
  18633.                !    If you use SET to create a variable with the same name
  18634.                     as one of the 4DOS, 4OS2, or 4DOS/NT internal
  18635.                     variables (see page 100), you will disable the
  18636.                     internal variable.  If you later execute a batch file
  18637.                     or alias that depends on that internal variable, it
  18638.                     may not operate correctly.
  18639.  
  18640.                     To display the contents of a single variable, type SET
  18641.                     plus the variable name:
  18642.  
  18643.                          c:\> set mine
  18644.  
  18645.                     You can edit environment variables with the ESET
  18646.                     command.  To remove variables from the environment,
  18647.                     use UNSET, or type SET plus a variable name and an
  18648.                     equal sign:
  18649.  
  18650.                          c:\> set mine=
  18651.  
  18652.                     The variable name is limited to a maximum of 80
  18653.                     characters.  Under 4DOS, the name and value together
  18654.                     cannot be longer than 255 characters.  In 4OS2 and
  18655.                     4DOS/NT, the maximum length for the name and value
  18656.                     together is 1,023 characters.
  18657.  
  18658.            4DOS ##  Unless you use /M, SET only affects the environment of
  18659.                     the current command processor and the programs it
  18660.                     executes.  If you EXIT to a parent command processor,
  18661.                     the original environment will be unchanged.
  18662.  
  18663.                     In 4DOS, the size of the environment is specified by
  18664.                     the Environment and EnvFree directives in 4DOS.INI
  18665.                     (see page 132) or by the /E: startup switch (see the
  18666.                     4DOS Introduction and Installation Guide).  In 4OS2
  18667.                     and 4DOS/NT the size of the environment is set
  18668.                     automatically.
  18669.  
  18670.         Options: ## /M(aster):  Display or modify the master environment
  18671.             4DOS    rather than the local environment.  This option only
  18672.                     makes sense in a secondary shell.
  18673.  
  18674.  
  18675.  
  18676.         -------------------------------------------------------------------
  18677.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 320
  18678.                                                                         SET
  18679.         -------------------------------------------------------------------
  18680.  
  18681.  
  18682.                     /P(ause):  Wait for a key to be pressed after each
  18683.                     screen page before continuing the display.  Your
  18684.                     options at the prompt are explained in detail on page
  18685.                     50.
  18686.  
  18687.                ##   /R(ead):  Read environment variables from a file.
  18688.                     This is much faster than loading variables from a
  18689.                     batch file with multiple SET commands.  Each entry in
  18690.                     the file must fit within the command-line length limit
  18691.                     for your command processor:  255 bytes for 4DOS and
  18692.                     1,023 bytes for 4OS2 and 4DOS/NT.  The file is in the
  18693.                     same format as the SET display, so SET /R can accept
  18694.                     as input a file generated by redirecting SET output.
  18695.                     For example, the following commands will save the
  18696.                     environment variables to a file, and then reload them
  18697.                     from that file:
  18698.  
  18699.                               set > varlist
  18700.                               set /r varlist
  18701.  
  18702.                     You can load variables from multiple files by listing
  18703.                     the filenames individually after the /R.  You can add
  18704.                     comments to a variable file by starting the comment
  18705.                     line with a colon [:].
  18706.  
  18707.                     If you are creating a SET /R file by hand, and need to
  18708.                     create an entry that spans multiple lines in the file,
  18709.                     you can do so by terminating each line, except the
  18710.                     last, with an escape character (see page 73).
  18711.                     However, you cannot use this method to exceed the
  18712.                     command-line length limit.
  18713.  
  18714.  
  18715.  
  18716.  
  18717.  
  18718.  
  18719.  
  18720.  
  18721.  
  18722.  
  18723.  
  18724.  
  18725.  
  18726.  
  18727.  
  18728.  
  18729.  
  18730.  
  18731.  
  18732.  
  18733.         -------------------------------------------------------------------
  18734.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 321
  18735.                                                                      SETDOS
  18736.         -------------------------------------------------------------------
  18737.  
  18738.  
  18739.         SETDOS                                                        (New)
  18740.  
  18741.         Purpose:    Display or set the 4DOS, 4OS2, or 4DOS/NT
  18742.                     configuration.
  18743.  
  18744.         Format:     SETDOS [/A? /B? /C? /D /E? /Fn.n /I+|- command /L? /M?
  18745.                          /N? /P? /R? /S?:? /U? /V? /X[+|-]n /Y]
  18746.  
  18747.                     /A(NSI)                  /N(o clobber)
  18748.                     /B(right background)     /P(arameter character)
  18749.                     /C(ompound)              /R(ows)
  18750.                     /D(escriptions)          /S(hape of cursor)
  18751.                     /E(scape character)      /U(pper case)
  18752.                     /F(ormat for @EVAL)      /V(erbose)
  18753.                     /I(nternal commands)     /X  (expansion)
  18754.                     /L(ine)                  /Y (single step)
  18755.                     /M(ode for editing)
  18756.  
  18757.         Usage:      SETDOS allows you to customize certain aspects of
  18758.                     4DOS, 4OS2, or 4DOS/NT to suit your personal tastes or
  18759.                     the configuration of your system.  Each of these
  18760.                     options is described below.
  18761.  
  18762.                     You can display the value of all SETDOS options by
  18763.                     entering the SETDOS command with no parameters.
  18764.  
  18765.                     Most of the SETDOS options can be initialized when the
  18766.                     command processor executes the directives in the .INI
  18767.                     file (see page 136).  The name of the corresponding
  18768.                     directive is listed in square brackets [ ] with each
  18769.                     option below; if none is listed, that option cannot be
  18770.                     set from the .INI file.  You can also define the
  18771.                     SETDOS options in your AUTOEXEC.BAT, 4START, or other
  18772.                     startup file (see page 85), in aliases, or at the
  18773.                     command line.
  18774.  
  18775.                     Secondary shells automatically inherit most
  18776.                     configuration settings currently in effect in the
  18777.                     previous shell.  If values have been changed by SETDOS
  18778.                     since 4DOS, 4OS2, or 4DOS/NT started, the new values
  18779.                     will be passed to the secondary shell.  For details on
  18780.                     inheritance of SETDOS values by secondary shells and
  18781.                     their relationship to the .INI file, see page 129.
  18782.  
  18783.                     SETDOS /I settings are not inherited by secondary
  18784.                     shells.  If you want to use SETDOS /I- to disable
  18785.                     commands in all shells, place the SETDOS command(s) in
  18786.                     your 4START file (see page 85), which is executed when
  18787.                     any shell starts.
  18788.  
  18789.  
  18790.         -------------------------------------------------------------------
  18791.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 322
  18792.                                                                      SETDOS
  18793.         -------------------------------------------------------------------
  18794.  
  18795.  
  18796.                     Many of the options below are marked with ##.  If you
  18797.                     are a new user, skip these and read the /M, /S, and /U
  18798.                     options, which are more common.
  18799.  
  18800.         Options: ## /A(NSI)  [ANSI]:  The ANSI option determines whether
  18801.                     4DOS will attempt to use ANSI escape sequences for the
  18802.             4DOS    CLS and COLOR commands.  4DOS normally determines this
  18803.                     itself, but if you are using a non-standard ANSI
  18804.                     driver or your loading sequence is unusual, you may
  18805.                     need to explicitly inform 4DOS.  /A0 allows 4DOS to
  18806.                     determine automatically whether an ANSI driver is
  18807.                     installed (the default).   /A1 forces 4DOS to assume
  18808.                     an ANSI driver is installed.  /A2 forces 4DOS to
  18809.                     assume an ANSI driver is not installed.  See page 25
  18810.                     for more information on ANSI drivers.
  18811.  
  18812.             4OS2    The /A(NSI) option and the corresponding ANSI
  18813.                     directive are not available in 4OS2.  ANSI support is
  18814.                     automatically turned on by 4OS2, which assumes that it
  18815.                     remains enabled.
  18816.  
  18817.             4NT     The /A(NSI) option and the corresponding ANSI
  18818.                     directive are not available in 4DOS/NT because Windows
  18819.                     NT does not provide ANSI support.
  18820.  
  18821.             4DOS,   /B(right background)  [BrightBG]:  The BRIGHTBG option
  18822.             4OS2    determines whether 4DOS and 4OS2 configure your video
  18823.                     adapter for blinking text (/B0, the default) or bright
  18824.                     background colors (/B1).  See page 26 for a detailed
  18825.                     discussion of this option.
  18826.  
  18827.                ##   /C(ompound character)  [CommandSep]:  The COMPOUND
  18828.                     option sets the character used for separating multiple
  18829.                     commands on the same line.  The default is the caret
  18830.                     [^] in 4DOS and the ampersand [&] in 4OS2 and 4DOS/NT.
  18831.                     You cannot use any of the redirection characters (| >
  18832.                     <), or the blank, tab, comma, or equal sign as the
  18833.                     command separator.  This example changes the COMPOUND
  18834.                     character to a tilde [~]:
  18835.  
  18836.                          c:\> setdos /c~
  18837.  
  18838.                     If you want to share batch files or aliases between
  18839.                     4DOS and 4OS2 or 4DOS/NT, see page 102 for information
  18840.                     on the %+ variable, which retrieves the current
  18841.                     command separator, and page 74 for details on using
  18842.                     compatible command separators for all the products you
  18843.                     use.
  18844.  
  18845.  
  18846.  
  18847.         -------------------------------------------------------------------
  18848.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 323
  18849.                                                                      SETDOS
  18850.         -------------------------------------------------------------------
  18851.  
  18852.  
  18853.                ##   /D(escriptions)  [Descriptions]:  The DESCRIPTIONS
  18854.                     option controls whether file processing commands like
  18855.                     COPY, DEL, MOVE, and REN process file descriptions
  18856.                     along with the files they belong to.  /D1 turns
  18857.                     description processing on, which is the default.  /D0
  18858.                     turns description processing off.
  18859.  
  18860.                ##   /E(scape character)  [EscapeChar]:  The ESCAPE option
  18861.                     sets the character used to suppress the normal meaning
  18862.                     of the following character.  Any character following
  18863.                     the escape character will be passed unmodified to the
  18864.                     command.  The default escape character is Ctrl-X
  18865.                     (ASCII 24, which appears on screen as an up-arrow) in
  18866.                     4DOS, and the caret [^] in 4OS2 and 4DOS/NT.  You
  18867.                     cannot use any of the redirection characters (| > <)
  18868.                     or the blank, tab, comma, or equal sign as the escape
  18869.                     character.  Certain characters (b, c, e, f, n, r, s,
  18870.                     and t) have special meanings when immediately preceded
  18871.                     by the escape character.  See page 73 for additional
  18872.                     details on the escape character.
  18873.  
  18874.                     If you want to share batch files or aliases between
  18875.                     4DOS and 4OS2 or 4DOS/NT, see page 102 for information
  18876.                     on the %= variable, which retrieves the current escape
  18877.                     character, and page 74 for details on using compatible
  18878.                     escape characters for all the products you use.
  18879.  
  18880.                     /F(ormat for @EVAL)  [EvalMax, EvalMin]:  The FORMAT
  18881.                     option lets you set default decimal precision for the
  18882.                     @EVAL variable function (see page 112). The maximum
  18883.                     precision is 16 digits to the left of the decimal
  18884.                     point and 8 digits to the right of the decimal point.
  18885.                     By default, the minimum precision to the right of the
  18886.                     decimal point is 0.
  18887.  
  18888.                     The general form of this option is /Fx.y, where the x
  18889.                     value sets the minimum number of digits to the right
  18890.                     of the decimal place and the y value sets the maximum
  18891.                     number of digits.  Both values can range from 0 to 8;
  18892.                     if x is greater than y, it is ignored.  You can
  18893.                     specify either or both values:  /F2.5, /F2, and /F.5
  18894.                     are all valid entries.  See the @EVAL function on page
  18895.                     112 if you want to set the precision for a single
  18896.                     computation.
  18897.  
  18898.                ##   /I(nternal):  The INTERNAL option allows you to
  18899.                     disable or enable internal commands.  To disable a
  18900.  
  18901.         -------------------------------------------------------------------
  18902.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 324
  18903.                                                                      SETDOS
  18904.         -------------------------------------------------------------------
  18905.  
  18906.  
  18907.                     command, precede the command name with a minus [-].
  18908.                     To re-enable a command, precede it with a plus [+].
  18909.                     For example, to disable the internal LIST command to
  18910.                     force 4DOS to use an external command:
  18911.  
  18912.                          c:\> setdos /i-list
  18913.  
  18914.          4DOS,  ##  /L(ine)  [LineInput]:  The LINE option controls how
  18915.          4OS2       4DOS or 4OS2 gets its input from the command line.
  18916.                     /L0 tells the command processor to use character input
  18917.                     (the default).  /L1 tells it to use line input (like
  18918.                     COMMAND.COM and CMD.EXE).  /L1 will disable command-
  18919.                     line editing, history recall, filename completion, and
  18920.                     the directory history window, and will reduce the 4OS2
  18921.                     input length limit from 1023 characters to 255
  18922.                     characters.  It should only be used if it is needed
  18923.                     for compatibility with a specific program.  If you
  18924.                     have a program that requires line input, you can use
  18925.                     the following line in an alias or batch file to change
  18926.                     the line input option just for that single program
  18927.                     (change the command separator to an ampersand [&] for
  18928.                     4OS2):
  18929.  
  18930.                          setdos /L1 ^ program %& ^ setdos /L0
  18931.  
  18932.                     See APPNOTES.DOC (for 4DOS) or README.DOC (for 4OS2)
  18933.                     for information on programs which require this option.
  18934.  
  18935.                     /M(ode)  [EditMode]:  The MODE option controls the
  18936.                     initial line editing mode.  To start in overstrike
  18937.                     mode at the beginning of each command line, use /M0
  18938.                     (the default).  To start in insert mode, use /M1.
  18939.  
  18940.                ##   /N(o clobber)  [NoClobber]:  The NOCLOBBER option
  18941.                     controls output redirection (see page 52).  /N0 means
  18942.                     existing files will be overwritten by output
  18943.                     redirection (with >) and that appending (with >>) does
  18944.                     not require the file to exist already.  This is the
  18945.                     default.  /N1 means existing files may not be
  18946.                     overwritten by output redirection, and that when
  18947.                     appending the output file must exist.  A /N1 setting
  18948.                     can be overridden with the [!] character.  If you use
  18949.                     /N1, you may have problems with a few unusual programs
  18950.                     that shell out to run a command with redirection, and
  18951.                     expect to be able to overwrite an existing file.
  18952.  
  18953.                ##   /P(arameter character)  [ParameterChar]:  This option
  18954.                     sets the character used after a percent sign to
  18955.                     specify all or all remaining command-line arguments in
  18956.                     a batch file or alias (e.g., %& or %n&; see pages 82
  18957.  
  18958.         -------------------------------------------------------------------
  18959.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 325
  18960.                                                                      SETDOS
  18961.         -------------------------------------------------------------------
  18962.  
  18963.  
  18964.                     and 168).  The default is the ampersand [&] for 4DOS
  18965.                     and the dollar sign [$] for 4OS2 and 4DOS/NT.
  18966.  
  18967.                     If you want to share batch files or aliases between
  18968.                     4DOS and 4OS2 or 4DOS/NT, see page 74 for details on
  18969.                     selecting compatible parameter characters for all the
  18970.                     products you use.
  18971.  
  18972.                ##   /R(ows)  [ScreenRows]:  The ROWS option sets the
  18973.                     number of screen rows used by the video display.
  18974.                     Normally 4DOS, 4OS2, and 4DOS/NT detect the screen
  18975.                     size, but if you have a non-standard display you may
  18976.                     need to set it explicitly.  This option does not
  18977.                     affect screen scrolling (that is controlled by your
  18978.                     video driver or, under 4DOS, the BIOS or ANSI.SYS); it
  18979.                     is used only for LIST, SELECT, the paged output
  18980.                     options (i.e., TYPE /P), and error checking in the
  18981.                     screen output commands.
  18982.  
  18983.                     /S(hape)  [CursorOver, CursorIns]:  The SHAPE option
  18984.                     sets the cursor shape.  The format is /So:i where o is
  18985.                     the cursor size for overstrike mode, i the cursor size
  18986.                     for insert mode.  The size is entered as a percentage
  18987.                     of the total character height.  The default values are
  18988.                     10:100 (an underscore cursor for overstrike mode, and
  18989.                     a block cursor for insert mode).  Because of the way
  18990.                     video BIOSes and drivers remap the cursor shape, you
  18991.                     may not get a smooth progression in the cursor size
  18992.                     from 0% - 100%.  To disable the cursor, enter /S0:0.
  18993.  
  18994.                     If either value is -1, , the command processor will
  18995.                     not attempt to modify the cursor shape at all.  You
  18996.                     can use this feature to give another program full
  18997.                     control of the cursor shape.
  18998.  
  18999.                     /U(pper)  [UpperCase]:  The UPPER option controls the
  19000.                     default case (upper or lower) for file and directory
  19001.                     names displayed by internal commands like COPY and
  19002.                     DIR.  /U0 displays file names in lower case (the
  19003.                     default).  /U1 displays file names in the traditional
  19004.                     upper case.  The /U setting is ignored for HPFS and
  19005.                     NTFS filenames under 4OS2 and 4DOS/NT, and FAT
  19006.                     filenames under Windows NT 3.5 and above.  HPFS and
  19007.                     NTFS names are always displayed in the case in which
  19008.                     they are stored; see page 17 for more details.
  19009.  
  19010.                ##   /V(erbose)  [BatchEcho]:  The VERBOSE option controls
  19011.                     the default for command echoing in batch files.  /V0
  19012.                     disables echoing of batch file commands unless ECHO is
  19013.                     explicitly set ON.  /V1, the default setting, enables
  19014.  
  19015.         -------------------------------------------------------------------
  19016.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 326
  19017.                                                                      SETDOS
  19018.         -------------------------------------------------------------------
  19019.  
  19020.  
  19021.                     echoing of batch file commands unless ECHO is
  19022.                     explicitly set OFF.
  19023.  
  19024.                     /V2 forces echoing of all batch file commands, even if
  19025.                     ECHO is set OFF or the line begins with an "@".  This
  19026.                     allows you to turn echoing on for a batch file without
  19027.                     editing the batch file and removing the ECHO OFF
  19028.                     command(s) within it.  /V2 is intended for debugging,
  19029.                     and can be set with SETDOS, but not with the BatchEcho
  19030.                     directive in 4DOS.INI.  For more information on batch
  19031.                     file debugging see page 89, and /Y (below).
  19032.  
  19033.                ##   /X[+|-]n  (expansion and special characters):  This
  19034.                     option enables and disables alias and environment
  19035.                     variable expansion, and controls whether special
  19036.                     characters have their usual meaning or are treated as
  19037.                     text.  It is most often used in batch files to process
  19038.                     text strings which may contain special characters.
  19039.                     See page 91 for further details on string processing
  19040.                     in batch files, and page 121 for details on alias
  19041.                     expansion, variable expansion, and special characters.
  19042.  
  19043.                     The features enabled or disabled by /X are numbered.
  19044.                     All features are enabled when the command processor
  19045.                     starts, and you can re-enable all features at any time
  19046.                     by using /X0.  To disable a particular feature, use
  19047.                     /X-n, where n is the feature number from the list
  19048.                     below.  To re-enable the feature, use /X+n.  To enable
  19049.                     or disable multiple individual features, list their
  19050.                     numbers in sequence after the + or - (e.g. /X-345 to
  19051.                     disable features 3, 4, and 5).
  19052.  
  19053.                     The features are:
  19054.  
  19055.                          1    All alias expansion.
  19056.                          2    Nested alias expansion only.
  19057.                          3    All variable expansion (includes environment
  19058.                               variables, batch file parameters, and alias
  19059.                               parameters).
  19060.                          4    Nested variable expansion only.
  19061.                          5    Multiple commands, conditional commands, and
  19062.                               piping (affects the command separator, ||,
  19063.                               &&, |, and |&).
  19064.                          6    Redirection (affects < , >,  >&, >&>, etc.).
  19065.                          7    Quoting (affects back-quotes [`] and double
  19066.                               quotes ["]).
  19067.                          8    Escape character.
  19068.  
  19069.                     If nested alias expansion is disabled, the first alias
  19070.                     of a command is expanded but any aliases it invokes
  19071.  
  19072.         -------------------------------------------------------------------
  19073.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 327
  19074.                                                                      SETDOS
  19075.         -------------------------------------------------------------------
  19076.  
  19077.  
  19078.                     are not expanded.  If nested variable expansion is
  19079.                     disabled, each variable is expanded once, but
  19080.                     variables containing the names of other variables are
  19081.                     not expanded further.
  19082.  
  19083.                     For example, to disable all features except alias
  19084.                     expansion while you are processing a text file
  19085.                     containing special characters:
  19086.  
  19087.                          setdos /x-35678
  19088.                          ... [perform text processing here]
  19089.                          setdos /x0
  19090.  
  19091.                ##   /Y (single step):  /Y1 enables single-stepping through
  19092.                     a batch file.  Each command is displayed on the screen
  19093.                     along with a Y/N/R (yes / no / remainder) prompt.
  19094.                     Press Y to execute the command, N to omit the command
  19095.                     and go on to the next, or R to execute the remainder
  19096.                     of the batch file (up to the next SETDOS /Y1 command).
  19097.                     You may also press Ctrl-C or Ctrl-Break to terminate
  19098.                     the batch file.  For more information on batch file
  19099.                     debugging, see page 89, and /V (above).
  19100.  
  19101.  
  19102.  
  19103.  
  19104.  
  19105.  
  19106.  
  19107.  
  19108.  
  19109.  
  19110.  
  19111.  
  19112.  
  19113.  
  19114.  
  19115.  
  19116.  
  19117.  
  19118.  
  19119.  
  19120.  
  19121.  
  19122.  
  19123.  
  19124.  
  19125.  
  19126.  
  19127.  
  19128.  
  19129.         -------------------------------------------------------------------
  19130.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 328
  19131.                                                                    SETLOCAL
  19132.         -------------------------------------------------------------------
  19133.  
  19134.  
  19135.         SETLOCAL                                                      (New)
  19136.  
  19137.         Purpose:    Save a copy of the current disk drive, directory,
  19138.                     environment, and alias list.
  19139.  
  19140.         Format:     SETLOCAL
  19141.  
  19142.                     See also:  ENDLOCAL.
  19143.  
  19144.         Usage:      SETLOCAL is used in batch files to save the default
  19145.                     disk drive and directory, the environment, and the
  19146.                     alias list to a reserved block of memory.  You can
  19147.                     then change their values and later restore the
  19148.                     original values with the ENDLOCAL command.
  19149.  
  19150.                     For example, this batch file fragment saves
  19151.                     everything, removes all aliases so that user aliases
  19152.                     will not affect batch file commands, changes the disk
  19153.                     and directory, modifies a variable, runs a program,
  19154.                     and then restores the original values:
  19155.  
  19156.                          setlocal
  19157.                          unalias *
  19158.                          cdd d:\test
  19159.                          set path=c:\;c:\dos;c:\util
  19160.                          rem run some program here
  19161.                          endlocal
  19162.  
  19163.                     SETLOCAL and ENDLOCAL are not nestable within a batch
  19164.                     file.  However, you can have multiple SETLOCAL /
  19165.                     ENDLOCAL pairs within a batch file, and nested batch
  19166.                     files can each have their own SETLOCAL / ENDLOCAL.
  19167.                     You cannot use SETLOCAL in an alias or at the command
  19168.                     line.
  19169.  
  19170.                     An ENDLOCAL is performed automatically at the end of a
  19171.                     batch file if you forget to do so.  If you invoke one
  19172.                     batch file from another without using CALL, the first
  19173.                     batch file is terminated, and an automatic ENDLOCAL is
  19174.                     performed.  The second batch file inherits the drive,
  19175.                     directory, aliases, and environment variables as they
  19176.                     were prior to any unterminated SETLOCAL.
  19177.  
  19178.             4DOS !  Do not load memory-resident programs (TSRs) from a
  19179.                     batch file while SETLOCAL is in effect.  If you do,
  19180.                     when ENDLOCAL is executed and the memory used by
  19181.                     SETLOCAL is released, a "hole" will be left in memory
  19182.                     below the TSR.  This is not usually harmful, but
  19183.                     wastes memory.
  19184.  
  19185.  
  19186.         -------------------------------------------------------------------
  19187.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 329
  19188.                                                                       SHIFT
  19189.         -------------------------------------------------------------------
  19190.  
  19191.  
  19192.         SHIFT                                                    (Enhanced)
  19193.  
  19194.         Purpose:    Allows the use of more than 127 batch file parameters
  19195.                     in a batch file.
  19196.  
  19197.         Format:     SHIFT [n]
  19198.  
  19199.                     n:  Number of positions to shift.
  19200.  
  19201.         Usage:      SHIFT is provided for compatibility with older batch
  19202.                     files, where it was used to access more than 10
  19203.                     parameters.  4DOS, 4OS2, and 4DOS/NT support 128
  19204.                     parameters (%0 to %127), so you may not need to use
  19205.                     SHIFT for batch files running exclusively under JP
  19206.                     Software command processors.
  19207.  
  19208.                     SHIFT moves each of the batch file parameters n
  19209.                     positions to the left.  The default value for n is 1.
  19210.                     SHIFT 1 moves the parameter in %1 to position %0, the
  19211.                     parameter in %2 becomes %1, etc.  You can reverse a
  19212.                     SHIFT by giving a negative value for n (i.e., after
  19213.                     SHIFT -1, the former %0 is restored, %0 becomes %1, %1
  19214.                     becomes %2, etc.).
  19215.  
  19216.                     SHIFT also affects the parameters %n& (command-line
  19217.                     tail; %n$ in 4OS2 and 4DOS/NT) and %# (number of
  19218.                     command arguments).
  19219.  
  19220.                     For example, create a batch file called TEST.BAT:
  19221.  
  19222.                          echo %1 %2 %3 %4
  19223.                          shift
  19224.                          echo %1 %2 %3 %4
  19225.                          shift 2
  19226.                          echo %1 %2 %3 %4
  19227.                          shift -1
  19228.                          echo %1 %2 %3 %4
  19229.  
  19230.                     Executing TEST.BAT produces the following results:
  19231.  
  19232.                          c:\> test one two three four five six seven
  19233.  
  19234.                          one two three four
  19235.                          two three four five
  19236.                          four five six seven
  19237.                          three four five six
  19238.  
  19239.  
  19240.  
  19241.  
  19242.  
  19243.         -------------------------------------------------------------------
  19244.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 330
  19245.                                                                       START
  19246.         -------------------------------------------------------------------
  19247.  
  19248.  
  19249.         START                                                         (New)
  19250.  
  19251.         Purpose:    Start a program in another session or window.
  19252.  
  19253.         Format:     The format for START depends on which command
  19254.                     processor you are using (see the Options section below
  19255.                     for additional minor differences in valid options
  19256.                     under 4DOS and 4OS2):
  19257.  
  19258.             4DOS,   START ["program title"] [/B[G] /C /DOS[=optfile] /F[G]
  19259.             4OS2    /FS /ICON=iconfile /INV /K /L /LA /LD /LH /MAX /MIN /N
  19260.                     /PGM progname /PM /POS=row,col,width,height /WIN
  19261.                     /WIN3[=optfile] /WIN3S[=optfile]] [command]
  19262.  
  19263.             4NT     START ["program title"] [/B /C /Dpath /HIGH /I
  19264.                     /INV /K /L /LA /LD /LH /LOW /MAX /MIN /NORMAL
  19265.                     /PGM progname /POS=row,col,width,height /REALTIME
  19266.                     /SEPARATE /SIZE=rows,columns /WAIT] [command]
  19267.  
  19268.                     program title:  Title to appear on title bar.
  19269.                     optfile:  Option settings file.
  19270.                     iconfile:  Name of icon (.ICO) file.
  19271.                     progname:  Program name (not the session name).
  19272.                     path:  Startup directory.
  19273.                     command:  Command to be executed.
  19274.  
  19275.                     /B (no new console)      /LOW (priority)
  19276.                     /B[G] (background )      /MAX(imized)
  19277.                     /C(lose when done)       /MIN(imized)
  19278.                     /D(irectory)             /N(o CMD.EXE)
  19279.                     /DOS (DOS session)       /NORMAL (priority)
  19280.                     /F[G] (foreground )      /PGM (program name)
  19281.                     /FS (full screen)        /PM (PM application)
  19282.                     /HIGH (priority)         /POS(ition of window)
  19283.                     /I(nherit environment)   /REALTIME (priority)
  19284.                     /ICON  (name .ICO file)  /SEPARATE (virtual machine)
  19285.                     /INV(isible)             /SIZE (of screen buffer)
  19286.                     /K(eep when done)        /WAIT (for session to finish)
  19287.                     /L(ocal lists)           /WIN(dowed session)
  19288.                     /LA (local aliases)      /WIN3  (enhanced mode)
  19289.                     /LD (local dir history)  /WIN3S  (standard mode)
  19290.                     /LH (local history list)
  19291.  
  19292.                     See also:  DETACH.
  19293.  
  19294.         Usage:      START is used to begin a new OS/2 session or Windows
  19295.                     NT window and, optionally, to run a program in that
  19296.                     session or window.  If you use START with no
  19297.                     parameters, it will begin a new session or window.  If
  19298.  
  19299.  
  19300.         -------------------------------------------------------------------
  19301.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 331
  19302.                                                                       START
  19303.         -------------------------------------------------------------------
  19304.  
  19305.  
  19306.                     you add a command, START will begin a new session or
  19307.                     window and execute that command.
  19308.  
  19309.                     The program title, if it is included, will appear on
  19310.                     the title bar, on the Presentation Manager task list
  19311.                     (OS/2 version 1.x) or window list (OS/2 version 2.x),
  19312.                     or on the task list and Alt-Tab displays (Windows NT).
  19313.                     The program title must be enclosed in quotation marks
  19314.                     and cannot exceed 60 characters in 4OS2 and 4DOS, or
  19315.                     127 characters in 4DOS/NT.  If the program title is
  19316.                     omitted, the program name will be used as the title.
  19317.  
  19318.                     You can use START if you are running 4OS2, 4DOS/NT, or
  19319.                     4DOS in an OS/2 2.1 or later DOS session.  START will
  19320.                     not work when running 4DOS under DOS, or DOS plus
  19321.                     Windows.
  19322.  
  19323.                     Although the START command has the same purpose in
  19324.                     4DOS, 4OS2, and 4DOS/NT, there are several subtle
  19325.                     differences between platforms.  The 4DOS and 4OS2
  19326.                     versions of START are similar because both rely on the
  19327.                     services of the OS/2 operating system.  The 4DOS/NT
  19328.                     version of START has different options available,
  19329.                     partly to maintain compatibility with the START
  19330.                     command in the Windows NT version of CMD.EXE, and
  19331.                     partly because of the features of and limitations
  19332.                     imposed by Windows NT.
  19333.  
  19334.                     START offers a large number of switches to control the
  19335.                     session you start.  In most cases you need only a few
  19336.                     switches to accomplish what you want.  The list below
  19337.                     summarizes the most commonly used START options, and
  19338.                     how you can use them to control the way a session is
  19339.                     started:
  19340.  
  19341.                          /MAX,  /MIN, and /POS allow you to start a
  19342.                          character-mode windowed session in a maximized
  19343.                          window, a minimized window, or a window with a
  19344.                          specified position and size.  The default is to
  19345.                          let the operating environment choose the position
  19346.                          and size of the window.
  19347.  
  19348.                          /C allows you to close the session when the
  19349.                          command is finished (the default for DOS, OS/2
  19350.                          Presentation Manager, and Windows NT graphical
  19351.                          sessions); /K allows you to keep the session open
  19352.                          and go to a prompt (the default for OS/2 and
  19353.                          Windows NT character mode sessions).
  19354.  
  19355.  
  19356.  
  19357.         -------------------------------------------------------------------
  19358.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 332
  19359.                                                                       START
  19360.         -------------------------------------------------------------------
  19361.  
  19362.  
  19363.             4OS2,        /BG and /FG allow you to start the session in the
  19364.             4DOS         background (does not respond to keystrokes until
  19365.                          selected) or foreground (responds to keystrokes
  19366.                          until deselected).  /FG is the default if /DOS,
  19367.                          /FS, /WIN, or /PM is used; otherwise, /BG is the
  19368.                          default.
  19369.  
  19370.             4OS2,        /FS and /WIN control whether a character-mode
  19371.             4DOS         session is started in full-screen or windowed
  19372.                          mode.  The default is to start a session of the
  19373.                          same type as the current session, if the
  19374.                          application can be run in such a session.
  19375.  
  19376.             4OS2,   Under 4OS2 and 4DOS/NT, START determines the
  19377.             4NT     application type automatically and starts the session
  19378.                     in the appropriate mode:  OS/2, Windows, DOS, full-
  19379.                     screen, windowed, or Presentation Manager for OS/2;
  19380.                     DOS, 16-bit Windows, 32-bit Windows, 32-bit Windows NT
  19381.                     (both graphical and character mode), 16-bit OS/2 1.x
  19382.                     character mode, or POSIX for Windows NT.
  19383.  
  19384.                     START gives you some flexibility in determining the
  19385.                     session mode.  For example, if the command is the name
  19386.                     of a batch file (either a .BTM or .CMD file), you can
  19387.                     use the /FS or /WIN options to run the batch file as
  19388.                     part of a new 4OS2 session in either full-screen or
  19389.                     windowed mode.
  19390.  
  19391.                     However, you cannot start a session in a mode that is
  19392.                     inappropriate for the application type.  A DOS
  19393.                     application cannot be run as part of a Presentation
  19394.                     Manager session, for example, even if you use the /PM
  19395.                     switch.  Invalid or conflicting options will be
  19396.                     ignored.  4OS2 and 4DOS/NT will always attempt to run
  19397.                     the command in the appropriate type of session.
  19398.  
  19399.             4DOS    The 4DOS START command is unable to determine the
  19400.                     application type.  If you don't specify the type on
  19401.                     the command line, 4DOS will start a new OS/2 session
  19402.                     to run it.
  19403.  
  19404.             4OS2 ## If the program is a DOS application or .BAT file, 4OS2
  19405.                     will return an error message in OS/2 version 1.x.  In
  19406.                     OS/2 version 2.x, 4OS2 will start a new DOS session to
  19407.                     run the program or batch file.  The DOS session will
  19408.                     close itself automatically as soon as the program or
  19409.                     batch file ends, unless /K is used.  If you want the
  19410.                     session to wait for a keystroke before it closes
  19411.                     itself, you can use the syntax:
  19412.  
  19413.  
  19414.         -------------------------------------------------------------------
  19415.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 333
  19416.                                                                       START
  19417.         -------------------------------------------------------------------
  19418.  
  19419.  
  19420.                          [c:\] start /DOS command ^^ pause
  19421.  
  19422.                     (Because the caret [^] is the default 4OS2 escape
  19423.                     character, two carets must be used in order to pass
  19424.                     one on to 4DOS as a command separator.)
  19425.  
  19426.             4OS2,   If you want to start a DOS command-line session in
  19427.             4DOS    OS/2 version 2.x, you can use the command:
  19428.  
  19429.                          [c:\] start /DOS
  19430.  
  19431.         4OS2, ! ##  Under OS/2, you can specify settings for DOS and
  19432.         4DOS        Windows sessions by using a settings options file, and
  19433.                     loading it with the /DOS=, /WIN3=, or /WIN3S= option.
  19434.                     This allows you to start DOS and Windows sessions with
  19435.                     specific settings without creating a desktop object
  19436.                     and modifying the settings manually.  Before using
  19437.                     this capability you should read the description of it
  19438.                     under /DOS= (below) very carefully, since errors in
  19439.                     the settings file can occasionally hang your system.
  19440.  
  19441.         Options:    Unlike most commands, the options below are not in
  19442.                     strictly alphabetical order.  Instead, they are
  19443.                     divided first by product, then alphabetically.
  19444.  
  19445.                     The following options are available in 4OS2, 4DOS/NT,
  19446.                     and 4DOS:
  19447.  
  19448.                          /C(lose):  The session or window is closed when
  19449.                          the application ends.
  19450.  
  19451.                          /INV(isible):  Start the session or window as
  19452.                          invisible.  No icon will appear and the session
  19453.                          will only be accessible through the Task Manager
  19454.                          or Window List.
  19455.  
  19456.                          /K(eep session or window at end):  The session or
  19457.                          window continues after the application program
  19458.                          ends.  Use the EXIT command to end the session.
  19459.  
  19460.                          /L(ocal lists):  Start the command processor with
  19461.                          local alias, history, and directory history
  19462.                          lists.  Under 4OS2 or 4DOS/NT, this option
  19463.                          combines the effects of /LA, /LD, and /LH
  19464.                          (below).
  19465.  
  19466.                          /LA:  Start the command processor with a local
  19467.                          alias list.  See page 169 for information on
  19468.                          local and global aliases.
  19469.  
  19470.  
  19471.         -------------------------------------------------------------------
  19472.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 334
  19473.                                                                       START
  19474.         -------------------------------------------------------------------
  19475.  
  19476.  
  19477.                          /LD:  Start the command processor with a local
  19478.                          directory history list.  See page 45 for
  19479.                          information on local and global directory
  19480.                          history.
  19481.  
  19482.                          /LH:  Start the command processor with a local
  19483.                          history list.  See page 39 for information on
  19484.                          local and global history lists.
  19485.  
  19486.                          /MAX(imized):  Start the session or window
  19487.                          maximized.
  19488.  
  19489.                          /MIN(imized):  Start the session or window
  19490.                          minimized.
  19491.  
  19492.                          /PGM:  The string following this option is the
  19493.                          program name.  The first quoted string on the
  19494.                          line will be used as the session and task list
  19495.                          title, and not as the program name.
  19496.  
  19497.                          /POS(ition):  Start the window at the specified
  19498.                          screen position.  The syntax is /POS=row, col,
  19499.                          width, height where the values are specified in
  19500.                          pixels or pels.  Under 4DOS and 4OS2, row and col
  19501.                          refer to the position of the bottom left corner
  19502.                          of the window relative to the bottom left corner
  19503.                          of the screen.  Under 4DOS/NT, row and col refer
  19504.                          to the position of the top left corner of the
  19505.                          window relative to the top left corner of the
  19506.                          screen.
  19507.  
  19508.             4OS2,   The following options are available in 4OS2 and 4DOS,
  19509.             4DOS    but not in 4DOS/NT:
  19510.  
  19511.                          /BG:  The session is started as a background
  19512.                          session.  /BG may be abbreviated to /B.
  19513.  
  19514.                          /DOS[=filename]:  Start a DOS session under OS/2
  19515.                          version 2.x.  This option is not available in
  19516.                          OS/2 version 1.x, which doesn't allow multiple
  19517.                          DOS sessions.
  19518.  
  19519.                          If you include the =filename, OS/2 will load DOS
  19520.                          settings from the specified file.  This option is
  19521.                          available only in the 32-bit version of 4OS2, and
  19522.                          in 4DOS.
  19523.  
  19524.                       !  Starting a session with specific DOS settings is
  19525.                          an undocumented feature which was implemented
  19526.                          within OS/2 with little error checking.  It is
  19527.  
  19528.         -------------------------------------------------------------------
  19529.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 335
  19530.                                                                       START
  19531.         -------------------------------------------------------------------
  19532.  
  19533.  
  19534.                          included in START because it substantially eases
  19535.                          a complex task, but you must experiment carefully
  19536.                          to ensure that the settings you select will work
  19537.                          properly on the systems on which you plan to use
  19538.                          them.  Incorrect settings may be ignored, but
  19539.                          they may also hang your session or stop the
  19540.                          entire system.  Be sure your experiments are not
  19541.                          conducted while critical tasks are in process.
  19542.  
  19543.                          Each line in the file must have a name, an equal
  19544.                          sign [=], and a value.  The names are those shown
  19545.                          in OS/2's DOS Settings dialog box.  Do not use
  19546.                          spaces on either side of the equal sign.
  19547.  
  19548.                          The names in the DOS Settings dialog box will
  19549.                          vary depending on the device drivers and other
  19550.                          settings in your CONFIG.SYS file, though many are
  19551.                          available on all systems.  You must ensure that
  19552.                          the names you use are valid for the systems on
  19553.                          which you use them.  For example, if you replace
  19554.                          IBM's COM.SYS and VCOM.SYS with different
  19555.                          communications drivers, the COM_ settings will
  19556.                          probably not be valid for the new drivers.  If
  19557.                          you have a settings file which contains settings
  19558.                          defined by a particular driver, and use it on a
  19559.                          system where the corresponding driver is not
  19560.                          loaded, the results are undefined.
  19561.  
  19562.                          The values in your settings file must be numeric
  19563.                          for settings which show a numeric value under DOS
  19564.                          Settings (e.g., DOS_FILES=30), and must be text
  19565.                          strings for settings shown with a string (e.g.,
  19566.                          DOS_SHELL=C:\4DOS.COM C:\4DOS /P).  Strings
  19567.                          should be entered without trailing blanks.  For
  19568.                          values shown as multiple choice on the DOS
  19569.                          Settings page you must specify a numeric value,
  19570.                          typically "0" for Off and 1 for On (e.g.,
  19571.                          DOS_HIGH=1).  Items with choices other than Off
  19572.                          and On may use different values, or may not work
  19573.                          at all; experimentation is usually required to
  19574.                          find out what works.  Attempting to use strings
  19575.                          for choice items (e.g., DOS_HIGH=ON) will not
  19576.                          work, and can hang your system.   This is due to
  19577.                          the internal operation of OS/2, and is not a
  19578.                          problem in 4OS2 or 4DOS.
  19579.  
  19580.                          A typical DOS settings file might look like this:
  19581.  
  19582.                               DOS_FILES=30
  19583.                               DOS_HIGH=1
  19584.  
  19585.         -------------------------------------------------------------------
  19586.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 336
  19587.                                                                       START
  19588.         -------------------------------------------------------------------
  19589.  
  19590.  
  19591.                               DOS_SHELL=C:\4DOS\4DOS.COM C:\4DOS /P
  19592.                               MOUSE_EXCLUSIVE_ACCESS=0
  19593.                               VIDEO_FASTPASTE=1
  19594.  
  19595.                          You can include comments in a settings file by
  19596.                          beginning any line with a colon [:].
  19597.  
  19598.                          /FG:  Start the session as the foreground
  19599.                          session.  /FG may be abbreviated to /F.
  19600.  
  19601.                          /FS:  Start the session as a full-screen session.
  19602.  
  19603.                          /ICON=filename:  Use the specified icon file.  If
  19604.                          you don't use /ICON, 4OS2 or 4DOS will look for
  19605.                          an .ICO file with the same file name and in the
  19606.                          same directory as the program file.  Some
  19607.                          versions of OS/2 may ignore this option and use
  19608.                          the default icon for the session.  If you
  19609.                          encounter this problem, check whether an update
  19610.                          to OS/2 has been released which addresses it.
  19611.  
  19612.                          /N(o CMD.EXE):  Under 4OS2, start an OS/2 program
  19613.                          directly, without a command processor.  The
  19614.                          command cannot be an internal command or batch
  19615.                          file.  This is the default for PM applications.
  19616.                          Under 4DOS, start a DOS program directly.
  19617.  
  19618.                          /PM:  Start a program in the PM session.
  19619.  
  19620.                          /WIN(dowed):  Start the session in a window.
  19621.  
  19622.                          /WIN3[=filename]:  Run the program in an
  19623.                          enhanced-mode Windows 3.x session.  The session
  19624.                          will run seamless (on the OS/2 desktop) if
  19625.                          started from 4OS2, or full-screen if started from
  19626.                          4DOS.  (To start a Windows application in full-
  19627.                          screen mode from 4OS2, use /FS rather than
  19628.                          /WIN3).  You can include an equal sign and the
  19629.                          name of an options file to set options for the
  19630.                          specific session and application (see /DOS= above
  19631.                          for details).  The setting names in the file
  19632.                          should be taken from those shown in OS/2's
  19633.                          WIN-OS/2 Settings dialog box.  Available only in
  19634.                          the 32-bit version of 4OS2, and in 4DOS.
  19635.  
  19636.                          /WIN3S[=filename]:  Equivalent to /WIN3, but runs
  19637.                          the program in standard mode rather than enhanced
  19638.                          mode.  Available only in 4OS2/32 and 4DOS.
  19639.  
  19640.  
  19641.  
  19642.         -------------------------------------------------------------------
  19643.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 337
  19644.                                                                       START
  19645.         -------------------------------------------------------------------
  19646.  
  19647.  
  19648.             4OS2,   The following options are available in 4OS2 and
  19649.             4NT     4DOS/NT, but cannot be used under 4DOS:
  19650.  
  19651.                          /I(nherit environment):  Inherit the default
  19652.                          environment specified in CONFIG.SYS, if any,
  19653.                          rather than the current environment.
  19654.  
  19655.                          /WAIT:  Wait for the new session or window to
  19656.                          finish before continuing.  Cannot be used with
  19657.                          /WIN3 or /WIN3S.
  19658.  
  19659.             4NT     The final group of options is only available under
  19660.                     4DOS/NT:
  19661.  
  19662.                          /B:  The program is started without creating a
  19663.                          new window or console.
  19664.  
  19665.                          /D(irectory):  Specifies the startup directory.
  19666.                          Include the directory immediately after the /D,
  19667.                          with no intervening spaces or punctuation.
  19668.  
  19669.                          /HIGH:  Start the window at high priority.
  19670.  
  19671.                          /LOW:  Start the window at low priority.
  19672.  
  19673.                          /NORMAL:  Start the window at normal priority.
  19674.  
  19675.                          /REALTIME:  Start the window at realtime
  19676.                          priority.
  19677.  
  19678.                          /SEPARATE:  Start a 16-bit Windows application in
  19679.                          a separate virtual machine (Windows NT 3.5 and
  19680.                          above only).
  19681.  
  19682.                          /SIZE:  Start the window with the specified
  19683.                          screen buffer size.  The full syntax is
  19684.                          /SIZE=rows, columns, where rows is the number of
  19685.                          text rows and columns is the number of text
  19686.                          columns.
  19687.  
  19688.  
  19689.  
  19690.  
  19691.  
  19692.  
  19693.  
  19694.  
  19695.  
  19696.  
  19697.  
  19698.  
  19699.         -------------------------------------------------------------------
  19700.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 338
  19701.                                                         [4DOS]     SWAPPING
  19702.         -------------------------------------------------------------------
  19703.  
  19704.  
  19705.         SWAPPING      [4DOS]                                          (New)
  19706.  
  19707.         Purpose:    Enable or disable 4DOS swapping, or display the
  19708.                     swapping state.
  19709.  
  19710.         Format:     SWAPPING [ON | OFF]
  19711.  
  19712.         ##  Usage:  SWAPPING temporarily disables or enables the swapping
  19713.                     of the transient portion of 4DOS to expanded memory,
  19714.                     extended memory, to XMS or to disk (see page 134).
  19715.  
  19716.                     Setting SWAPPING OFF is particularly useful for
  19717.                     speeding up batch files (including AUTOEXEC.BAT) when
  19718.                     4DOS is using disk swapping.  When you are running
  19719.                     several small programs from a batch file, disk
  19720.                     swapping can sometimes cause a noticeable delay.
  19721.                     However, if you disable swapping, there will be about
  19722.                     128K less memory available for large application
  19723.                     programs.
  19724.  
  19725.                     The following batch file fragment disables swapping,
  19726.                     runs several programs, and then re-enables swapping:
  19727.  
  19728.                          swapping off
  19729.                          c:\util\mouse
  19730.                          c:\video\ansi.com
  19731.                          cls bright white on blue
  19732.                          c:\bin\cache.com
  19733.                          swapping on
  19734.  
  19735.                     If you enter SWAPPING with no arguments, 4DOS displays
  19736.                     the current swapping type (XMS, EMS, Disk, or None)
  19737.                     and state:
  19738.  
  19739.                          c:\> swapping
  19740.                          SWAPPING (XMS) is ON
  19741.  
  19742.                     Setting SWAPPING OFF does not close the disk swap file
  19743.                     or release any reserved EMS or XMS memory.
  19744.  
  19745.                     You may have trouble if you load memory-resident
  19746.                     programs (TSRs) with SWAPPING OFF and unload them with
  19747.                     SWAPPING ON, or vice versa.  Many TSRs expect the
  19748.                     system to be in the same state when they unload that
  19749.                     it was in when they loaded, and variation from this
  19750.                     norm may cause the TSR to unload improperly or hang
  19751.                     your system.
  19752.  
  19753.  
  19754.  
  19755.  
  19756.         -------------------------------------------------------------------
  19757.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 339
  19758.                                                                         TEE
  19759.         -------------------------------------------------------------------
  19760.  
  19761.  
  19762.         TEE                                                           (New)
  19763.  
  19764.         Purpose:    Copy standard input to both standard output and a
  19765.                     file.
  19766.  
  19767.         Format:     TEE [/A] file...
  19768.  
  19769.                     file:  One or more files that will receive the "tee-d"
  19770.                     output.
  19771.  
  19772.                     /A(ppend)
  19773.  
  19774.                     See also:  Y, and the redirection options (page 52).
  19775.  
  19776.         ##  Usage:  TEE is normally used to "split" the output of a
  19777.                     program so that you can see it on the display and also
  19778.                     save it in a file.  It can also be used to capture
  19779.                     intermediate output before the data is altered by
  19780.                     another program or command.
  19781.  
  19782.                     TEE gets its input from standard input (usually the
  19783.                     piped output of another command or program), and sends
  19784.                     out two copies:  one goes to standard output, the
  19785.                     other to the file or files that you specify.  TEE is
  19786.                     not likely to be useful with programs which do not use
  19787.                     standard output, because these programs cannot send
  19788.                     output through a pipe.  See page 55 for more
  19789.                     information on pipes.
  19790.  
  19791.                     For example, to search the file DOC for any lines
  19792.                     containing the string "4DOS", make a copy of the
  19793.                     matching lines in 4.DAT, sort the lines, and write
  19794.                     them to the output file 4D.DAT:
  19795.  
  19796.                          c:\> find "4DOS" doc | tee 4.dat | sort > 4d.dat
  19797.  
  19798.                     If you are typing at the keyboard to produce the input
  19799.                     for TEE, you must enter a Ctrl-Z to terminate the
  19800.                     input.
  19801.  
  19802.             4DOS    When using TEE with a pipe under 4DOS, the previous
  19803.                     command writes its output to a temporary file.  When
  19804.                     that command finishes, TEE begins operation and can
  19805.                     read the temporary file, display the output, and write
  19806.                     it to the file(s) named in the TEE command.
  19807.  
  19808.             4OS2,   When using TEE with a pipe under 4OS2 or 4DOS/NT, the
  19809.             4NT     programs on the two ends of the pipe run
  19810.                     simultaneously, not sequentially as in 4DOS.  See page
  19811.                     56 for more information.
  19812.  
  19813.         -------------------------------------------------------------------
  19814.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 340
  19815.                                                                         TEE
  19816.         -------------------------------------------------------------------
  19817.  
  19818.  
  19819.         Option:     /A(ppend):  Append the output to the file(s) rather
  19820.                     than overwriting them.
  19821.  
  19822.  
  19823.  
  19824.  
  19825.  
  19826.  
  19827.  
  19828.  
  19829.  
  19830.  
  19831.  
  19832.  
  19833.  
  19834.  
  19835.  
  19836.  
  19837.  
  19838.  
  19839.  
  19840.  
  19841.  
  19842.  
  19843.  
  19844.  
  19845.  
  19846.  
  19847.  
  19848.  
  19849.  
  19850.  
  19851.  
  19852.  
  19853.  
  19854.  
  19855.  
  19856.  
  19857.  
  19858.  
  19859.  
  19860.  
  19861.  
  19862.  
  19863.  
  19864.  
  19865.  
  19866.  
  19867.  
  19868.  
  19869.  
  19870.         -------------------------------------------------------------------
  19871.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 341
  19872.                                                                        TEXT
  19873.         -------------------------------------------------------------------
  19874.  
  19875.  
  19876.         TEXT                                                          (New)
  19877.  
  19878.         Purpose:    Display a block of text in a batch file.
  19879.  
  19880.         Format:     TEXT
  19881.                          .
  19882.                          .
  19883.                          .
  19884.                     ENDTEXT
  19885.  
  19886.                     See also:  ECHO, SCREEN, SCRPUT, and VSCRPUT.
  19887.  
  19888.         Usage:      TEXT can only be used in batch files.
  19889.  
  19890.                     The TEXT command is useful for displaying menus or
  19891.                     multi-line messages.  TEXT will display all subsequent
  19892.                     lines in the batch file until terminated by ENDTEXT.
  19893.                     Both TEXT and ENDTEXT must be entered as the only
  19894.                     command on the line.
  19895.  
  19896.                     To redirect the entire block of text, use redirection
  19897.                     on the TEXT command itself, but not on the actual text
  19898.                     lines or the ENDTEXT line.  No environment variable
  19899.                     expansion or other processing is performed on the
  19900.                     lines between TEXT and ENDTEXT; they are displayed
  19901.                     exactly as they are stored in the batch file.
  19902.  
  19903.             4DOS,   If you are running 4OS2, or 4DOS with an ANSI driver
  19904.             4OS2    loaded, you can change screen colors by inserting ANSI
  19905.                     escape sequences anywhere in the text block.  This
  19906.                     will not work in 4DOS/NT, because Windows NT does not
  19907.                     provide ANSI support.  You can also use a CLS or COLOR
  19908.                     command in 4DOS, 4OS2, or 4DOS/NT to set the screen
  19909.                     color before executing the TEXT command.
  19910.  
  19911.                     The following batch file fragment displays a simple
  19912.                     menu:
  19913.  
  19914.                          @echo off
  19915.                          cls
  19916.                          screen 2 0
  19917.                          text
  19918.                          Enter one of the following:
  19919.                          1 - Spreadsheet
  19920.                          2 - Word Processing
  19921.                          3 - DOS Utilities
  19922.                          Enter your selection :
  19923.                          endtext
  19924.  
  19925.  
  19926.  
  19927.         -------------------------------------------------------------------
  19928.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 342
  19929.                                                                        TIME
  19930.         -------------------------------------------------------------------
  19931.  
  19932.  
  19933.         TIME                                                   (Compatible)
  19934.  
  19935.         Purpose:    Display or set the current system time.
  19936.  
  19937.         Format:     TIME [hh[:mm[:ss]]] [AM | PM]
  19938.  
  19939.                     hh:  The hour (0 - 23).
  19940.                     mm:  The minute (0 - 59).
  19941.                     ss:  The second (0 - 59).
  19942.  
  19943.                     See also:  CHCP and DATE
  19944.  
  19945.         Usage:      If you don't enter any parameters, TIME will display
  19946.                     the current system time and prompt you for a new time.
  19947.                     Press Enter if you don't wish to change the time;
  19948.                     otherwise, enter the new time:
  19949.  
  19950.                          c:\> time
  19951.                          Wed  Dec 22, 1993  9:30:10
  19952.                          New time (hh:mm:ss):
  19953.  
  19954.                     TIME defaults to 24-hour format, but you can
  19955.                     optionally enter the time in 12-hour format by
  19956.                     appending "a", "am", "p", or "pm" to the time you
  19957.                     enter.
  19958.  
  19959.                     For example, to enter the time as 9:30 am:
  19960.  
  19961.                          c:\> time 9:30 am
  19962.  
  19963.                     The operating system adds the system time and date to
  19964.                     the directory entry for every file you create or
  19965.                     modify.  If you keep both the time and date accurate,
  19966.                     you will have a record of when you last updated each
  19967.                     file.
  19968.  
  19969.  
  19970.  
  19971.  
  19972.  
  19973.  
  19974.  
  19975.  
  19976.  
  19977.  
  19978.  
  19979.  
  19980.  
  19981.  
  19982.  
  19983.  
  19984.         -------------------------------------------------------------------
  19985.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 343
  19986.                                                                       TIMER
  19987.         -------------------------------------------------------------------
  19988.  
  19989.  
  19990.         TIMER                                                         (New)
  19991.  
  19992.         Purpose:    TIMER is a system stopwatch.
  19993.  
  19994.         Format:     TIMER [ON] [/1 /2 /3 /S]
  19995.  
  19996.                     ON:  Force the stopwatch to restart
  19997.  
  19998.                     /1 (stopwatch #1)                /3 (stopwatch #3)
  19999.                     /2 (stopwatch #2)                /S(plit)
  20000.  
  20001.         Usage:      The TIMER command turns a system stopwatch on and off.
  20002.                     When you first run TIMER, the stopwatch starts:
  20003.  
  20004.                          c:\> timer
  20005.                          Timer 1 on:  12:21:46
  20006.  
  20007.                     When you run TIMER again, the stopwatch stops and the
  20008.                     elapsed time is displayed:
  20009.  
  20010.                          c:\> timer
  20011.                          Timer 1 off:  12:21:58   Elapsed time: 0:00:12.06
  20012.  
  20013.                     There are three stopwatches available (1, 2, and 3) so
  20014.                     you can time multiple overlapping events.  By default,
  20015.                     TIMER uses stopwatch #1.
  20016.  
  20017.                     TIMER is particularly useful for timing events in
  20018.                     batch files.  For example, to time both an entire
  20019.                     batch file, and an intermediate section of the same
  20020.                     file, you could use commands like this:
  20021.  
  20022.                          rem Turn on timer 1
  20023.                          timer
  20024.                          rem Do some work here
  20025.                          rem Turn timer 2 on to time the next section
  20026.                          timer /2
  20027.                          rem Do some more work
  20028.                          echo Intermediate section completed
  20029.                          rem Display time taken in intermediate section
  20030.                          timer /2
  20031.                          rem Do some more work
  20032.                          rem Now display the total time
  20033.                          timer
  20034.  
  20035.                     The smallest interval TIMER can measure depends on the
  20036.                     operating system you are using, your hardware, and the
  20037.                     interaction between the two.  However, it should never
  20038.                     be greater than .06 second.  The largest interval is
  20039.                     23 hours, 59 minutes, 59.99 seconds.
  20040.  
  20041.         -------------------------------------------------------------------
  20042.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 344
  20043.                                                                       TIMER
  20044.         -------------------------------------------------------------------
  20045.  
  20046.  
  20047.         Options:    /1:  Use timer #1 (the default).
  20048.  
  20049.                     /2:  Use timer #2.
  20050.  
  20051.                     /3:  Use timer #3.
  20052.  
  20053.                     /S(plit):  Display a split time without stopping the
  20054.                     timer.  To display the current elapsed time but leave
  20055.                     the timer running:
  20056.  
  20057.                          c:\> timer /s
  20058.                          Timer 1 elapsed: 0:06:40.63
  20059.  
  20060.                     ON:  Start the timer regardless of its previous state
  20061.                     (on or off).  Otherwise the TIMER command toggles the
  20062.                     timer state (unless /S is used).
  20063.  
  20064.  
  20065.  
  20066.  
  20067.  
  20068.  
  20069.  
  20070.  
  20071.  
  20072.  
  20073.  
  20074.  
  20075.  
  20076.  
  20077.  
  20078.  
  20079.  
  20080.  
  20081.  
  20082.  
  20083.  
  20084.  
  20085.  
  20086.  
  20087.  
  20088.  
  20089.  
  20090.  
  20091.  
  20092.  
  20093.  
  20094.  
  20095.  
  20096.  
  20097.  
  20098.         -------------------------------------------------------------------
  20099.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 345
  20100.                                                         [4DOS/NT]     TITLE
  20101.         -------------------------------------------------------------------
  20102.  
  20103.  
  20104.         TITLE      [4DOS/NT]                                   (Compatible)
  20105.  
  20106.         Purpose:    Change the window title.
  20107.  
  20108.         Format:     TITLE "title"
  20109.  
  20110.                     title:  The new window title
  20111.  
  20112.                     See also:  ACTIVATE and WINDOW.
  20113.  
  20114.         Usage:      TITLE changes the text that appears in the caption bar
  20115.                     at the top of the 4DOS/NT window.  It is included only
  20116.                     for compatibility with CMD.EXE.  You can also change
  20117.                     the window title with the WINDOW command or the
  20118.                     ACTIVATE command.
  20119.  
  20120.                     The title text must be enclosed in double quotes.  The
  20121.                     quotes will not appear as part of the actual title.
  20122.  
  20123.                     To change the title of the current window to "4DOS for
  20124.                     Windows NT":
  20125.  
  20126.                          [c:\] title "4DOS for Windows NT"
  20127.  
  20128.  
  20129.  
  20130.  
  20131.  
  20132.  
  20133.  
  20134.  
  20135.  
  20136.  
  20137.  
  20138.  
  20139.  
  20140.  
  20141.  
  20142.  
  20143.  
  20144.  
  20145.  
  20146.  
  20147.  
  20148.  
  20149.  
  20150.  
  20151.  
  20152.  
  20153.  
  20154.  
  20155.         -------------------------------------------------------------------
  20156.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 346
  20157.                                                         [4DOS]     TRUENAME
  20158.         -------------------------------------------------------------------
  20159.  
  20160.  
  20161.         TRUENAME      [4DOS]                                          (New)
  20162.  
  20163.         Purpose:    Find the full, true path and file name for a file.
  20164.  
  20165.         Format:     TRUENAME file
  20166.  
  20167.                     file:  The file whose name TRUENAME will report.
  20168.  
  20169.                     See also:  @TRUENAME variable function on page 119.
  20170.  
  20171.         Usage:      Default directories, as well as the JOIN and SUBST
  20172.                     external commands, can obscure the true name of a
  20173.                     file.  TRUENAME "sees through" these obstacles and
  20174.                     reports the fully qualified name of a file.
  20175.  
  20176.                     The following example uses TRUENAME to get the true
  20177.                     pathname for a file:
  20178.  
  20179.                          c:\> subst d: c:\util\test
  20180.                          c:\> truename d:\test.exe
  20181.                          c:\util\test\test.exe
  20182.  
  20183.                     TRUENAME requires MS-DOS or PC-DOS 3.0 or above,
  20184.                     DR DOS or Novell DOS 6.0 or above, or OS/2 version 2.0
  20185.                     or above.
  20186.  
  20187.                     TRUENAME can handle simple drive substitutions such as
  20188.                     those created by JOIN, SUBST, or most network drive
  20189.                     mappings.  However it may not be able to correctly
  20190.                     determine the true name if you use "nested" JOIN or
  20191.                     SUBST commands, or a network which does not report
  20192.                     true names properly.
  20193.  
  20194.  
  20195.  
  20196.  
  20197.  
  20198.  
  20199.  
  20200.  
  20201.  
  20202.  
  20203.  
  20204.  
  20205.  
  20206.  
  20207.  
  20208.  
  20209.  
  20210.  
  20211.  
  20212.         -------------------------------------------------------------------
  20213.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 347
  20214.                                                                        TYPE
  20215.         -------------------------------------------------------------------
  20216.  
  20217.  
  20218.         TYPE                                                     (Enhanced)
  20219.  
  20220.         Purpose:    Display the contents of the specified file(s).
  20221.  
  20222.         Format:     TYPE [/A[[:][-]rhsda] /L /P] file...
  20223.  
  20224.                     file:  The file or list of files that you want to
  20225.                     display.
  20226.  
  20227.                     /A(ttribute select)      /P(ause)
  20228.                     /L(ine numbers)
  20229.  
  20230.                     See also:  LIST.
  20231.  
  20232.         Selection:  Supports extended wildcards, ranges, multiple file
  20233.                     names, and include lists (see pages 59 - 67).
  20234.  
  20235.         Usage:      The TYPE command displays a file.  It is normally only
  20236.                     useful for displaying ASCII text files.  Executable
  20237.                     files (.COM and .EXE) and many data files may be
  20238.                     unreadable when displayed with TYPE because they
  20239.                     include non-alphanumeric characters.
  20240.  
  20241.                     To display the files MEMO1 and MEMO2:
  20242.  
  20243.                          c:\> type /p memo1 memo2
  20244.  
  20245.                     You can press Ctrl-S to pause TYPE's display and then
  20246.                     any key to continue.
  20247.  
  20248.                     You will probably find LIST to be more useful for
  20249.                     displaying files.  However, the TYPE /L command used
  20250.                     with redirection (see page 52) is useful if you want
  20251.                     to add line numbers to a file.
  20252.  
  20253.         Options: ## /A(ttribute select): Select only those files that have
  20254.                     the specified attribute(s) set.  Preceding the
  20255.                     attribute character with a hyphen [-] will select
  20256.                     files that do not have that attribute set.  The
  20257.                     attributes are:
  20258.  
  20259.                          R    Read-only         D    Subdirectory
  20260.                          H    Hidden            A    Archive
  20261.                          S    System
  20262.  
  20263.                     If no attributes are listed at all (e.g., TYPE /A
  20264.                     ...), TYPE will select all files and subdirectories
  20265.                     including hidden and system files.  If attributes are
  20266.                     combined, all the specified attributes must match for
  20267.                     a file to be selected.  For example, /A:RHS will
  20268.  
  20269.         -------------------------------------------------------------------
  20270.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 348
  20271.                                                                        TYPE
  20272.         -------------------------------------------------------------------
  20273.  
  20274.  
  20275.                     select only those files with all three attributes set.
  20276.                     See page 18 for more information on file attributes.
  20277.  
  20278.                     /L(ine numbers):  Display a line number preceding each
  20279.                     line of text.
  20280.  
  20281.                     /P(ause):  Prompt after displaying each page.  Your
  20282.                     options at the prompt are explained in detail on page
  20283.                     50.
  20284.  
  20285.  
  20286.  
  20287.  
  20288.  
  20289.  
  20290.  
  20291.  
  20292.  
  20293.  
  20294.  
  20295.  
  20296.  
  20297.  
  20298.  
  20299.  
  20300.  
  20301.  
  20302.  
  20303.  
  20304.  
  20305.  
  20306.  
  20307.  
  20308.  
  20309.  
  20310.  
  20311.  
  20312.  
  20313.  
  20314.  
  20315.  
  20316.  
  20317.  
  20318.  
  20319.  
  20320.  
  20321.  
  20322.  
  20323.  
  20324.  
  20325.  
  20326.         -------------------------------------------------------------------
  20327.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 349
  20328.                                                                     UNALIAS
  20329.         -------------------------------------------------------------------
  20330.  
  20331.  
  20332.         UNALIAS                                                       (New)
  20333.  
  20334.         Purpose:    Remove aliases from the alias list.
  20335.  
  20336.         Format:     UNALIAS [/Q] alias...
  20337.  
  20338.                          or
  20339.  
  20340.                     UNALIAS *
  20341.  
  20342.                     alias:  One or more aliases to remove from memory.
  20343.  
  20344.                     /Q(uiet)
  20345.  
  20346.                     See also:  ALIAS and ESET.
  20347.  
  20348.         Usage:      4DOS, 4OS2, and 4DOS/NT maintain a list of the aliases
  20349.                     that you have defined.  The UNALIAS command will
  20350.                     remove aliases from that list.  You can remove one or
  20351.                     more aliases by name, or you can delete the entire
  20352.                     alias list by using the command UNALIAS *.
  20353.  
  20354.                     For example, to remove the alias DDIR:
  20355.  
  20356.                          c:\> unalias ddir
  20357.  
  20358.                     To remove all the aliases:
  20359.  
  20360.                          c:\> unalias *
  20361.  
  20362.         Options:    /Q(uiet):  Prevents UNALIAS from displaying an error
  20363.                     message if one or more of the aliases does not exist.
  20364.                     This option is most useful in batch files, for
  20365.                     removing a group of aliases when some of the aliases
  20366.                     may not have been defined.
  20367.  
  20368.  
  20369.  
  20370.  
  20371.  
  20372.  
  20373.  
  20374.  
  20375.  
  20376.  
  20377.  
  20378.  
  20379.  
  20380.  
  20381.  
  20382.  
  20383.         -------------------------------------------------------------------
  20384.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 350
  20385.                                                                       UNSET
  20386.         -------------------------------------------------------------------
  20387.  
  20388.  
  20389.         UNSET                                                         (New)
  20390.  
  20391.         Purpose:    Remove variables from the environment.
  20392.  
  20393.         Format:     UNSET  [/M /Q] name...
  20394.                          or
  20395.                     UNSET *
  20396.  
  20397.                     name:  One or more variables to remove from the
  20398.                     environment.
  20399.  
  20400.                     /M(aster environment)            /Q(uiet)
  20401.  
  20402.                     See also:  ESET and SET.
  20403.  
  20404.         Usage:      UNSET removes one or more variables from the
  20405.                     environment.  For example, to remove the variable
  20406.                     CMDLINE:
  20407.  
  20408.                          c:\> unset cmdline
  20409.  
  20410.                     If you use the command UNSET *, all of the environment
  20411.                     variables will be deleted:
  20412.  
  20413.                          c:\> unset *
  20414.  
  20415.                     UNSET is often used in conjunction with the SETLOCAL
  20416.                     and ENDLOCAL commands in order to clear the
  20417.                     environment of variables that may cause problems for
  20418.                     some applications.
  20419.  
  20420.                     For more information on environment variables, see the
  20421.                     SET command and the general discussions on pages 21
  20422.                     and 96.
  20423.  
  20424.                !    Use caution when removing environment variables, and
  20425.                     especially when using UNSET *.  Many programs will not
  20426.                     work properly without certain environment variables;
  20427.                     for example, 4DOS depends on PATH and COMSPEC, and
  20428.                     4OS2 uses PATH and DPATH.
  20429.  
  20430.         Options: ## /M(aster):  Remove the variable from the master
  20431.             4DOS    environment rather than the local environment.  This
  20432.                     option only makes sense if used in a secondary shell.
  20433.  
  20434.                     /Q(uiet):  Prevents UNSET from displaying an error
  20435.                     message if one or more of the variables does not
  20436.                     exist.  This option is most useful in batch files, for
  20437.                     removing a group of variables when some of the
  20438.                     variables may not have been defined.
  20439.  
  20440.         -------------------------------------------------------------------
  20441.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 351
  20442.                                                                         VER
  20443.         -------------------------------------------------------------------
  20444.  
  20445.  
  20446.         VER                                                      (Enhanced)
  20447.  
  20448.         Purpose:    Display the current command processor and operating
  20449.                     system versions.
  20450.  
  20451.         Format:     VER [/R]
  20452.  
  20453.                     /R(evision level)
  20454.  
  20455.         Usage:      Version numbers consist of a one-digit major version
  20456.                     number, a period, and a one- or two-digit minor
  20457.                     version number.  The VER command displays both version
  20458.                     numbers:
  20459.  
  20460.                          c:\> ver
  20461.  
  20462.                          4DOS 5.0   DOS 6.0
  20463.  
  20464.             4DOS    4DOS's VER command will automatically detect OS/2 and
  20465.                     DR DOS or Novell DOS and display the corresponding
  20466.                     operating system name and version number.  For
  20467.                     example:
  20468.  
  20469.                          c:\> ver
  20470.  
  20471.                          4DOS 5.0   OS/2 2.1
  20472.  
  20473.         Option:     /R(evision level):  Display the command processor and
  20474.                     operating system internal revision level (if any),
  20475.                     plus your 4DOS, 4OS2, or 4DOS/NT serial number and
  20476.                     registered name.
  20477.  
  20478.                     Under 4DOS, /R also displays whether DOS is loaded
  20479.                     into the high memory area (HMA), is resident in ROM,
  20480.                     or is in normal base memory.  This output is only
  20481.                     meaningful in MS-DOS or PC-DOS version 5.0 or above or
  20482.                     in an OS/2 2.x DOS session.
  20483.  
  20484.  
  20485.  
  20486.  
  20487.  
  20488.  
  20489.  
  20490.  
  20491.  
  20492.  
  20493.  
  20494.  
  20495.  
  20496.  
  20497.         -------------------------------------------------------------------
  20498.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 352
  20499.                                                                      VERIFY
  20500.         -------------------------------------------------------------------
  20501.  
  20502.  
  20503.         VERIFY                                                 (Compatible)
  20504.  
  20505.         Purpose:    Enable or disable disk write verification or display
  20506.                     the verification state.
  20507.  
  20508.         Format:     VERIFY [ON | OFF]
  20509.  
  20510.         Usage:      DOS and OS/2 maintain an internal verify flag.  When
  20511.                     the flag is on, the operating system attempts to
  20512.                     verify each disk write by making sure that the data
  20513.                     written to the disk can be read back successfully into
  20514.                     the computer.  It does not compare the data written
  20515.                     with the data actually placed on disk.
  20516.  
  20517.             4NT     Disk write verification cannot actually be enabled or
  20518.                     disabled under Windows NT.  4DOS/NT supports VERIFY as
  20519.                     a "do-nothing" command, for compatibility with
  20520.                     CMD.EXE.  This avoids "unknown command" errors in
  20521.                     batch files which use the VERIFY command.  The
  20522.                     additional discussion below applies only to 4DOS and
  20523.                     4OS2, and not to 4DOS/NT.
  20524.  
  20525.                     If used without any parameters, VERIFY will display
  20526.                     the state of the verify flag:
  20527.  
  20528.                          c:\> verify
  20529.                          VERIFY is OFF
  20530.  
  20531.                     VERIFY is off when the system boots up.  Once it is
  20532.                     turned on with the VERIFY ON command, it stays on
  20533.                     until you use the VERIFY OFF command or until you
  20534.                     reboot.
  20535.  
  20536.                     Verification will slow your disk write operations
  20537.                     slightly (the effect is not usually noticeable).
  20538.  
  20539.  
  20540.  
  20541.  
  20542.  
  20543.  
  20544.  
  20545.  
  20546.  
  20547.  
  20548.  
  20549.  
  20550.  
  20551.  
  20552.  
  20553.  
  20554.         -------------------------------------------------------------------
  20555.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 353
  20556.                                                                         VOL
  20557.         -------------------------------------------------------------------
  20558.  
  20559.  
  20560.         VOL                                                      (Enhanced)
  20561.  
  20562.         Purpose:    Display disk volume label(s).
  20563.  
  20564.         Format:     VOL [d:] ...
  20565.  
  20566.                     d:  The drive or drives to search for labels.
  20567.  
  20568.         Usage:      Each disk may have a volume label, created when the
  20569.                     disk is formatted or with the external LABEL command.
  20570.                     Also, every floppy disk formatted with DOS version 4.0
  20571.                     or above, OS/2, or Windows NT has a volume serial
  20572.                     number.
  20573.  
  20574.                     The VOL command will display the volume label and, if
  20575.                     available, the volume serial number of a disk volume.
  20576.                     If the disk doesn't have a volume label, VOL will
  20577.                     report that it is "unlabeled."  If you don't specify a
  20578.                     drive, VOL displays information about the current
  20579.                     drive:
  20580.  
  20581.                          c:\> vol
  20582.                          Volume in drive C: is MYHARDDISK
  20583.  
  20584.                     If available, the volume serial number will appear
  20585.                     after the drive label or name.
  20586.  
  20587.                     To display the disk labels for drives A and B:
  20588.  
  20589.                          c:\> vol a: b:
  20590.                          Volume in drive A: is unlabeled
  20591.                          Volume in drive B: is BACKUP_2
  20592.  
  20593.  
  20594.  
  20595.  
  20596.  
  20597.  
  20598.  
  20599.  
  20600.  
  20601.  
  20602.  
  20603.  
  20604.  
  20605.  
  20606.  
  20607.  
  20608.  
  20609.  
  20610.  
  20611.         -------------------------------------------------------------------
  20612.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 354
  20613.                                                                     VSCRPUT
  20614.         -------------------------------------------------------------------
  20615.  
  20616.  
  20617.         VSCRPUT                                                       (New)
  20618.  
  20619.         Purpose:    Display text vertically in the specified color.
  20620.  
  20621.         Format:     VSCRPUT  row col [BRIght] [BLInk] fg ON [BRIght] bg
  20622.                     text
  20623.  
  20624.                     row:  Starting row number.
  20625.                     col:  Starting column number.
  20626.                     fg:  Foreground text color.
  20627.                     bg:  Background text color.
  20628.                     text:  The text to display.
  20629.  
  20630.                     See also:  SCRPUT.
  20631.  
  20632.         Usage:      VSCRPUT writes text vertically on the screen rather
  20633.                     than horizontally.  Like the SCRPUT command, it uses
  20634.                     the colors you specify to write the text.  VSCRPUT can
  20635.                     be used for simple graphs and charts generated by
  20636.                     batch files.  It always leaves the cursor in its
  20637.                     current position.  See page 26 for details about
  20638.                     colors and color names, and notes on the use of bright
  20639.                     background colors.
  20640.  
  20641.                     The row and column are zero-based, so on a standard 25
  20642.                     line by 80 column display, valid rows are 0 - 24 and
  20643.                     valid columns are 0 - 79.  You can also specify the
  20644.                     row and column as offsets from the current cursor
  20645.                     position.  Begin the value with a plus sign [+] to
  20646.                     move down the specified number of rows or to the right
  20647.                     the specified number of columns before displaying
  20648.                     text, or with a minus sign [-] to move up or to the
  20649.                     left.
  20650.  
  20651.                     The following batch file fragment displays an X and Y
  20652.                     axis and labels them:
  20653.  
  20654.                          cls bright white on blue
  20655.                          drawhline 20 10 40 1 bright white on blue
  20656.                          drawvline 2 10 19 1 bright white on blue
  20657.                          scrput 21 20 bright red on blue X axis
  20658.                          vscrput 8 9 bright red on blue Y axis
  20659.  
  20660.                     VSCRPUT checks for a valid row and column, and
  20661.                     displays a "Usage" error message if either value is
  20662.                     out of range.
  20663.  
  20664.            4DOS ##  VSCRPUT normally writes text directly to the screen.
  20665.                     If you have an unusual display adapter which does not
  20666.  
  20667.  
  20668.         -------------------------------------------------------------------
  20669.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 355
  20670.                                                                     VSCRPUT
  20671.         -------------------------------------------------------------------
  20672.  
  20673.  
  20674.                     support direct video output, see the OutputBIOS
  20675.                     directive on page 150.
  20676.  
  20677.  
  20678.  
  20679.  
  20680.  
  20681.  
  20682.  
  20683.  
  20684.  
  20685.  
  20686.  
  20687.  
  20688.  
  20689.  
  20690.  
  20691.  
  20692.  
  20693.  
  20694.  
  20695.  
  20696.  
  20697.  
  20698.  
  20699.  
  20700.  
  20701.  
  20702.  
  20703.  
  20704.  
  20705.  
  20706.  
  20707.  
  20708.  
  20709.  
  20710.  
  20711.  
  20712.  
  20713.  
  20714.  
  20715.  
  20716.  
  20717.  
  20718.  
  20719.  
  20720.  
  20721.  
  20722.  
  20723.  
  20724.  
  20725.         -------------------------------------------------------------------
  20726.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 356
  20727.                                                  [4OS2, 4DOS/NT]     WINDOW
  20728.         -------------------------------------------------------------------
  20729.  
  20730.  
  20731.         WINDOW      [4OS2, 4DOS/NT]                                   (New)
  20732.  
  20733.         Purpose:    Minimize or maximize the current window, restore the
  20734.                     default window size, or change the window title.
  20735.  
  20736.         Format:     WINDOW [MIN | MAX | RESTORE] [/POS=row,col,width,
  20737.                     height] [/SIZE=rows,columns] ["title"]
  20738.  
  20739.                     title:  A new title for the window.
  20740.  
  20741.                     /POS(ition)              /SIZE (of screen buffer)
  20742.  
  20743.                     See also:  ACTIVATE and TITLE.
  20744.  
  20745.         Usage:      WINDOW is used to control the appearance and title of
  20746.                     the current window.  WINDOW MIN reduces the window to
  20747.                     an icon, WINDOW MAX enlarges it to its maximum size,
  20748.                     and WINDOW RESTORE returns the window to its default
  20749.                     size and location on the desktop.
  20750.  
  20751.                     You can use the /POS option to set the location and
  20752.                     size of the window on the desktop.  The row and column
  20753.                     values of the /POS option select the window's origin
  20754.                     while the width and height values determine its size.
  20755.  
  20756.                     If you specify a new title, the title text must be
  20757.                     enclosed in double quotes.  The quotes will not appear
  20758.                     as part of the actual title.
  20759.  
  20760.         Options:    /POS(ition):  Set the window screen position and size.
  20761.                     The syntax is /POS=row, col, width, height where the
  20762.                     values are specified in pixels or pels.  Under 4OS2,
  20763.                     row and col refer to the position of the bottom left
  20764.                     corner of the window relative to the bottom left
  20765.                     corner of the screen.  Under 4DOS/NT, row and col
  20766.                     refer to the position of the top left corner of the
  20767.                     window relative to the top left corner of the screen.
  20768.  
  20769.                     /SIZE (of screen buffer):  Specify the screen buffer
  20770.                     size.  The full syntax is /SIZE=rows, columns, where
  20771.                     rows is the number of text rows and columns is the
  20772.                     number of text columns.
  20773.  
  20774.  
  20775.  
  20776.  
  20777.  
  20778.  
  20779.  
  20780.  
  20781.  
  20782.         -------------------------------------------------------------------
  20783.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 357
  20784.                                                                           Y
  20785.         -------------------------------------------------------------------
  20786.  
  20787.  
  20788.         Y                                                             (New)
  20789.  
  20790.         Purpose:    Copy standard input to standard output, and then copy
  20791.                     the specified file(s) to standard output.
  20792.  
  20793.         Format:     Y file ...
  20794.  
  20795.                     file:  The file or list of files to send to standard
  20796.                     output.
  20797.  
  20798.                     See also:  TEE.
  20799.  
  20800.         ##  Usage:  The Y command copies input from standard input
  20801.                     (usually the keyboard) to standard output (usually the
  20802.                     screen).  Once the input ends, the named files are
  20803.                     appended to standard output.
  20804.  
  20805.                     For example, to get text from standard input, append
  20806.                     the files MEMO1 and MEMO2 to it, and send the output
  20807.                     to MEMOS:
  20808.  
  20809.                          c:\> y memo1 memo2 > memos
  20810.  
  20811.                     The Y command is most useful if you want to add
  20812.                     redirected data to the beginning of a file instead of
  20813.                     appending it to the end.  For example, this command
  20814.                     copies the output of DIR, followed by the contents of
  20815.                     the file DIREND, to the file DIRALL:
  20816.  
  20817.                          c:\> dir | y dirend > dirall
  20818.  
  20819.                     If you are typing at the keyboard to produce input
  20820.                     text for Y, you must enter a Ctrl-Z to terminate the
  20821.                     input.
  20822.  
  20823.                !    When using Y with a pipe under 4OS2 or 4DOS/NT, you
  20824.                     must take into account that the programs on the two
  20825.                     ends of the pipe run simultaneously, not sequentially.
  20826.                              56                    See page    for more information.
  20827.  
  20828.  
  20829.  
  20830.  
  20831.  
  20832.  
  20833.  
  20834.  
  20835.  
  20836.  
  20837.  
  20838.  
  20839.         -------------------------------------------------------------------
  20840.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 358
  20841.                                                 APPENDIX A / ERROR MESSAGES
  20842.         -------------------------------------------------------------------
  20843.  
  20844.  
  20845.  
  20846.         APPENDIX A / ERROR MESSAGES
  20847.  
  20848.  
  20849.         This appendix lists error messages generated by 4DOS, 4OS2, and
  20850.         4DOS/NT, and includes a recommended course of action for most
  20851.         errors.  If you are unable to resolve the problem, look through
  20852.         your Introduction and Installation Guide for any additional
  20853.         troubleshooting recommendations, then contact JP Software for
  20854.         technical support (see page 7).
  20855.  
  20856.         Error messages relating to files are generally reports of errors
  20857.         returned by the operating system.  You may find some of these
  20858.         messages (for example, "Access denied") vague enough that they are
  20859.         not always helpful.  4DOS, 4OS2, and 4DOS/NT include the file name
  20860.         in file error messages, but are often unable to determine a more
  20861.         accurate explanation of these errors.  The message shown is the
  20862.         best information available based on the error codes returned by the
  20863.         operating system.
  20864.  
  20865.         For some errors you are instructed to "restart the session or
  20866.         reboot the system."  This means that you should attempt to correct
  20867.         the error by closing and restarting the current session under OS/2,
  20868.         Windows NT, or a DOS task switcher or multitasker (including
  20869.         Windows).  Under DOS without a multitasker or task switcher, you
  20870.         will probably have to reboot the system to correct the problem.
  20871.  
  20872.         The following list includes all error messages, in alphabetical
  20873.         order:
  20874.  
  20875.     4DOS     4DOS internal stack overflow:  You attempted to nest batch
  20876.              files or commands like DO, EXCEPT, FOR, IF, IFF, GLOBAL, or
  20877.              SELECT too deep, and 4DOS ran out of stack space.  Restructure
  20878.              your command, alias, or batch file, or use the StackSize
  20879.              directive in 4DOS.INI to increase 4DOS's internal stack size.
  20880.  
  20881.     4DOS     4DOS initialization error --:  An error occurred during the
  20882.              4DOS startup process.  Look up the rest of the message in this
  20883.              list for a more specific explanation.
  20884.  
  20885.     4DOS     4DOS server error --:  An error occurred in communication
  20886.              between 4DOS's resident and transient portions.  A more
  20887.              specific error message follows.
  20888.  
  20889.     4DOS     4DOS swapping failed, loading in non-swapping mode:  None of
  20890.              the swapping options worked, so 4DOS loaded in non-swapping
  20891.              mode, which requires about 128K more memory than swapping
  20892.              mode.  Check your Swapping specification in 4DOS.INI, and/or
  20893.              free some XMS or EMS memory or disk space.
  20894.  
  20895.  
  20896.         -------------------------------------------------------------------
  20897.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 359
  20898.                                                 APPENDIX A / ERROR MESSAGES
  20899.         -------------------------------------------------------------------
  20900.  
  20901.  
  20902.     4DOS     4DOS unrecoverable error XX:  An error occurred in the
  20903.              resident portion of 4DOS.  These errors will terminate
  20904.              secondary shells and, and may require you to reboot the system
  20905.              or restart the session if they occur during a primary shell or
  20906.              if 4DOS cannot continue.  The error codes are:
  20907.  
  20908.                   BI     Bad function code.  Contact JP Software.
  20909.                   DI     Same as Disk swap file corrupted.
  20910.                   DR     Same as Swap file read error.
  20911.                   DS     Same as Swap file seek error.
  20912.                   EI     Same as EMS mapping error.
  20913.                   NS     No number for new shell.  You have started too
  20914.                          many 4DOS secondary shells without properly
  20915.                          exiting some of them, perhaps by closing DESQview
  20916.                          windows rather than EXITing.  Clean up any work
  20917.                          in process and reboot the system or restart the
  20918.                          session.
  20919.                   PT     Illegal process termination.  Contact JP
  20920.                          Software.
  20921.                   TS     Terminated inactive shell.  Contact JP Software.
  20922.                   XI     Same as XMS move failed.
  20923.  
  20924.              Access denied:  You tried to write to or erase a read-only
  20925.              file, rename a file or directory to an existing name, create a
  20926.              directory that already exists, remove a read-only directory or
  20927.              a directory with files or subdirectories still in it, or
  20928.              access a file in use by another program in a multitasking
  20929.              system.
  20930.  
  20931.     4DOS     Address table missing:  Your 4DOS.COM file is invalid.  If you
  20932.              used an executable file compression program on 4DOS.COM, the
  20933.              compression may not be compatible with 4DOS.  Re-install
  20934.              4DOS.COM from diskette, or download a new copy.
  20935.  
  20936.              Alias loop:  An alias refers back to itself either directly or
  20937.              indirectly (i.e., a = b = a), or aliases are nested more than
  20938.              16 deep.  Correct your alias list.
  20939.  
  20940.     4DOS     Attempt to exit from root shell:  Another program has probably
  20941.              destroyed a portion of 4DOS's memory.  Reboot the system or
  20942.              restart the session; if the error persists, contact JP
  20943.              Software.
  20944.  
  20945.              Bad disk unit:  Generally caused by a disk drive hardware
  20946.              failure.
  20947.  
  20948.     4DOS     Bad environment:  The DOS environment has a bad structure,
  20949.              probably because a program destroyed 4DOS's master environment
  20950.              space.  Reboot the system or restart the session.
  20951.  
  20952.  
  20953.         -------------------------------------------------------------------
  20954.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 360
  20955.                                                 APPENDIX A / ERROR MESSAGES
  20956.         -------------------------------------------------------------------
  20957.  
  20958.  
  20959.              Batch file missing:  4DOS, 4OS2, or 4DOS/NT can't find the
  20960.              batch (.BAT or .CMD) file it was running.  It was either
  20961.              deleted, renamed, moved, or the disk was changed.  Correct the
  20962.              problem and rerun the file.
  20963.  
  20964.              Can't copy file to itself:  You cannot COPY or MOVE a file to
  20965.              itself.  4DOS, 4OS2, and 4DOS/NT perform full path and
  20966.              filename expansion before copying to ensure that files aren't
  20967.              inadvertently destroyed.
  20968.  
  20969.              Can't create:  The command processor can't create the
  20970.              specified file.  The disk may be full or write protected, or
  20971.              the file already exists and is read-only, or the root
  20972.              directory is full.
  20973.  
  20974.              Can't delete:  The command processor can't delete the
  20975.              specified file or directory.  The disk is probably write
  20976.              protected.
  20977.  
  20978.              Can't get directory:  The command processor can't read the
  20979.              directory.  The disk drive is probably not ready.
  20980.  
  20981.              Can't make directory entry:  The command processor can't
  20982.              create the filename in the directory.  This is usually caused
  20983.              by a full root directory.  Create a subdirectory and move some
  20984.              of the files to it.
  20985.  
  20986.              Can't open:  The command processor can't open the specified
  20987.              file.  Either the file doesn't exist or the disk directory or
  20988.              File Allocation Table is damaged.
  20989.  
  20990.              Can't remove current directory:  You attempted to remove the
  20991.              current directory, which the operating system does not allow.
  20992.              Change to the parent directory and try again.
  20993.  
  20994.     4DOS     Can't set up disk swap file:  The disk swap file you specified
  20995.              cannot be opened.  The path or drive is invalid, the disk is
  20996.              full, DOS is out of file handles, or there is a hardware
  20997.              problem.  Check 4DOS.INI to be sure your Swapping directive is
  20998.              correct.
  20999.  
  21000.              Command line too long:  A single command exceeded 255
  21001.              characters in 4DOS or 1023 characters in 4OS2 or 4DOS/NT, or
  21002.              the entire command line exceeded 511 characters in 4DOS, or
  21003.              2047 characters in 4OS2 or 4DOS/NT, during alias and variable
  21004.              expansion.  Reduce the complexity of the command or use a
  21005.              batch file.  Also check for an alias which refers back to
  21006.              itself either directly or indirectly.
  21007.  
  21008.  
  21009.  
  21010.         -------------------------------------------------------------------
  21011.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 361
  21012.                                                 APPENDIX A / ERROR MESSAGES
  21013.         -------------------------------------------------------------------
  21014.  
  21015.  
  21016.              Command only valid in batch file:  You have tried to use a
  21017.              batch file command, like DO or GOSUB, from the command line or
  21018.              in an alias.  A few commands can only be used in batch files
  21019.              (see the individual commands for details).
  21020.  
  21021.     4DOS     Command tail too long, truncated:  A program attempted to pass
  21022.              a command in an improper format or a command longer than 126
  21023.              characters to a 4DOS secondary shell.  This is probably a bug
  21024.              in the program from which 4DOS was loaded.  Contact the author
  21025.              of the program or JP Software for technical assistance.
  21026.  
  21027.              Contents lost before copy:  COPY was appending files, and
  21028.              found one of the source files is the same as the target.  That
  21029.              source file is skipped, and appending continues with the next
  21030.              file.
  21031.  
  21032.              Data error:  The operating system can't read or write properly
  21033.              to the device.  On a floppy drive, this error is usually
  21034.              caused by a defective floppy disk, dirty disk drive heads, or
  21035.              a misalignment between the heads on your drive and the drive
  21036.              on which the disk was created.  On a hard drive, this error
  21037.              may indicate a drive that is too hot or too cold, or a
  21038.              hardware problem.  Retry the operation; if it fails again,
  21039.              correct the hardware or diskette problem.
  21040.  
  21041.              Directory stack empty:  POPD or DIRS can't find any entries in
  21042.              the directory stack.
  21043.  
  21044.              Disk is write protected:  The disk cannot be written to.
  21045.              Check the disk and remove the write-protect tab or close the
  21046.              write-protect window if necessary.
  21047.  
  21048.     4DOS     Disk swap file corrupted:  The 4DOS disk swapping file
  21049.              (4DOSSWAP.nnn or xxxxxxxx.4SW) has been moved, deleted, or
  21050.              damaged by another program.  Reboot the system or restart the
  21051.              session.
  21052.  
  21053.              Drive not ready -- close door:  The floppy disk drive door is
  21054.              open.  Close the door and try again.
  21055.  
  21056.     4DOS     EMS deallocation failed:  4DOS can't deallocate EMS memory
  21057.              when exiting from a secondary shell.  The EMS map has been
  21058.              corrupted or the memory area used by 4DOS or the EMS driver
  21059.              has been destroyed by a program.  Clean up any work in process
  21060.              and reboot the system or restart the session.
  21061.  
  21062.     4DOS     EMS map save or restore failed:  4DOS cannot save or restore
  21063.              the EMS page map.  The EMS map has been corrupted, memory has
  21064.              been destroyed by a program, or you have an incompatible EMS
  21065.  
  21066.  
  21067.         -------------------------------------------------------------------
  21068.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 362
  21069.                                                 APPENDIX A / ERROR MESSAGES
  21070.         -------------------------------------------------------------------
  21071.  
  21072.  
  21073.              driver.  If this error recurs, try another swapping method,
  21074.              update your EMS driver, or contact JP Software.
  21075.  
  21076.     4DOS     EMS mapping failed:  4DOS can't map EMS pages when swapping to
  21077.              or from EMS.  The EMS map has been corrupted or the memory
  21078.              area used by the loader or the EMS driver has been destroyed
  21079.              by a program.  Reboot the system or restart the session.
  21080.  
  21081.              Environment already saved:  You have already saved the
  21082.              environment with a previous SETLOCAL command.  You cannot nest
  21083.              SETLOCAL / ENDLOCAL pairs.
  21084.  
  21085.              Error in command-line directive:  You used the //iniline
  21086.              option to place an .INI directive on the startup command line,
  21087.              or, under 4DOS, on the SHELL= line in CONFIG.SYS, but the
  21088.              directive is in error.  A more specific error message follows.
  21089.  
  21090.              Error on line [nnnn] of [filename]:  There is an error in your
  21091.              .INI file.  The following message explains the error in more
  21092.              detail.  Correct the line in error and restart the command
  21093.              processor for your change to take effect.
  21094.  
  21095.              Error reading:  The operating system experienced an I/O error
  21096.              when reading from a device.  This is usually caused by a bad
  21097.              disk, a device not ready, or a hardware error.
  21098.  
  21099.              Error writing:  The operating system experienced an I/O error
  21100.              when writing to a device.  This is usually caused by a full
  21101.              disk, a bad disk, a device not ready, or a hardware error.
  21102.  
  21103.              Exceeded batch nesting limit:  You have attempted to nest
  21104.              batch files more than 10 levels deep.
  21105.  
  21106.     4DOS     Fatal error -- please reboot:  4DOS cannot continue due to the
  21107.              previous error.  Reboot the system or restart the session.
  21108.  
  21109.              File Allocation Table bad:  The operating system  can't access
  21110.              the FAT on the specified disk.  This can be caused by a bad
  21111.              disk, a hardware error, or an unusual software interaction.
  21112.  
  21113.              File exists:  The requested output file already exists, and
  21114.              the command processor won't overwrite it.
  21115.  
  21116.              File is empty:  You attempted to LIST a file with no data (a
  21117.              zero-byte file).
  21118.  
  21119.              File not found:  4DOS, 4OS2, or 4DOS/NT couldn't find the
  21120.              specified file.  Check the spelling and path name.
  21121.  
  21122.  
  21123.  
  21124.         -------------------------------------------------------------------
  21125.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 363
  21126.                                                 APPENDIX A / ERROR MESSAGES
  21127.         -------------------------------------------------------------------
  21128.  
  21129.  
  21130.              General failure:  This is usually a hardware problem,
  21131.              particularly a disk drive failure or a device not properly
  21132.              connected to a serial or parallel port.  Try to correct the
  21133.              problem, or reboot and try again.  Also see Data error above;
  21134.              the problems described there can sometimes cause a general
  21135.              failure rather than a data error.
  21136.  
  21137.     4DOS     I/O error in [filename], some directives may not have been
  21138.              processed:  An I/O error occurred while reading your 4DOS.INI
  21139.              file.  There may be a physical problem with data on the disk
  21140.              or a sharing error on a multitasking system.  Check your
  21141.              4DOS.INI file and try again.
  21142.  
  21143.              Infinite COPY or MOVE loop:  You tried to COPY or MOVE a
  21144.              directory to one of its own subdirectories and used the /S
  21145.              switch, so the command would run forever.  Correct the command
  21146.              and try again.
  21147.  
  21148.              Insufficient disk space:  COPY or MOVE ran out of room on the
  21149.              destination drive.  Remove some files and retry the operation.
  21150.  
  21151.     4DOS     Insufficient load space:  There is not enough room in 4DOS's
  21152.              internal memory areas to include all of the options you
  21153.              requested in 4DOS.INI.  Contact JP Software for assistance.
  21154.  
  21155.     4DOS     Internal DOS error:  DOS encountered an internal bug and
  21156.              failed. Reboot the system.
  21157.  
  21158.     4DOS     Invalid AUTOEXEC filename:  You specified an invalid path or
  21159.              filename for the AUTOEXEC file with the /P: startup switch, or
  21160.              with the DOS_AUTOEXEC setting in an OS/2 DOS session.  The
  21161.              default name will be used instead.  Correct the filename, then
  21162.              reboot the system or restart the session.
  21163.  
  21164.              Invalid character value:  You gave an invalid value for a
  21165.              character directive in the .INI file.
  21166.  
  21167.              Invalid choice value:  You gave an invalid value for a
  21168.              "choice" directive (one that accepts a choice from a list,
  21169.              like "Yes" or "No") in the .INI file.
  21170.  
  21171.              Invalid color:  You gave an invalid value for a color
  21172.              directive in the .INI file.
  21173.  
  21174.              Invalid date:  An invalid date was entered.  Check the syntax
  21175.              and reenter.
  21176.  
  21177.              Invalid directive name:  4DOS, 4OS2, or 4DOS/NT can't
  21178.              recognize the name of a directive in your .INI file.
  21179.  
  21180.  
  21181.         -------------------------------------------------------------------
  21182.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 364
  21183.                                                 APPENDIX A / ERROR MESSAGES
  21184.         -------------------------------------------------------------------
  21185.  
  21186.  
  21187.     4DOS     Invalid DOS version:  You need a newer version of DOS to
  21188.              execute the specified command.
  21189.  
  21190.              Invalid drive:  A bad or non-existent disk drive was
  21191.              specified.
  21192.  
  21193.     4DOS     Invalid INI file path or name, file not processed:  The path
  21194.              or name for the initialization file on the SHELL= line in
  21195.              CONFIG.SYS, or on the startup command line, is invalid.
  21196.              Correct the @d:\path\inifile option to name the correct file.
  21197.  
  21198.              Invalid key name:  You tried to make an invalid key
  21199.              substitution in the .INI file, or you used an invalid key name
  21200.              in a keystroke alias or command.  Correct the error and retry
  21201.              the operation.
  21202.  
  21203.              Invalid numeric [or character] value:  You gave an invalid
  21204.              value for a numeric directive in the .INI file, or for a
  21205.              character directive in 4DOS.INI.
  21206.  
  21207.              Invalid parameter:  The command processor didn't recognize a
  21208.              parameter.  Check the syntax and spelling of the command you
  21209.              entered.
  21210.  
  21211.              Invalid path:  The specified path does not exist.  Check the
  21212.              disk specification and/or spelling.
  21213.  
  21214.              Invalid path or file name:  You used an invalid path or
  21215.              filename in a directive in the .INI file.
  21216.  
  21217.     4DOS     Invalid startup switch, ignored:  You passed 4DOS an invalid
  21218.              option on the SHELL= line in CONFIG.SYS or on the startup
  21219.              command line for a secondary shell.  Correct the switch.
  21220.  
  21221.     4DOS     Invalid Swapping option or path:  The swap type or disk swap
  21222.              path in the 4DOS.INI Swapping directive is invalid.  4DOS
  21223.              ignores the bad swap type or path and attempts to scan the
  21224.              rest of the Swapping specification for a valid option.
  21225.              Multiple errors in the Swapping directive will cause this
  21226.              message to repeat.  Correct 4DOS.INI and reboot the system or
  21227.              restart the session.
  21228.  
  21229.              Invalid time:  An invalid time was entered.  Check the syntax
  21230.              and reenter.
  21231.  
  21232.              Keystroke substitution table full:  4DOS, 4OS2, or 4DOS/NT ran
  21233.              out of room to store keystroke substitutions entered in the
  21234.              .INI file.  Reduce the number of key substitutions or contact
  21235.              JP Software for assistance.
  21236.  
  21237.  
  21238.         -------------------------------------------------------------------
  21239.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 365
  21240.                                                 APPENDIX A / ERROR MESSAGES
  21241.         -------------------------------------------------------------------
  21242.  
  21243.  
  21244.     4DOS     KSTACK.COM not loaded:  You attempted to execute a KEYSTACK
  21245.              command without loading KSTACK.COM.  See the KEYSTACK command
  21246.              for more information.
  21247.  
  21248.              Label not found:  A GOTO or GOSUB referred to a non-existent
  21249.              label. Check your batch file.
  21250.  
  21251.     4DOS     Memory [allocation | deallocation] error:  4DOS can't allocate
  21252.              or deallocate memory while loading, or while reserving or
  21253.              releasing memory for internal use.  DOS memory allocation has
  21254.              been corrupted, or another application has reserved memory
  21255.              incorrectly.  Reboot the system or restart the session.
  21256.  
  21257.     4DOS     Memory destroyed:  The DOS memory control blocks have been
  21258.              corrupted.  Reboot the system or restart the session.
  21259.  
  21260.              Missing ENDTEXT:  A TEXT command is missing a matching
  21261.              ENDTEXT.  Check the batch file.
  21262.  
  21263.              Missing GOSUB:  The command processor cannot perform the
  21264.              RETURN command in a batch file.  You tried to do a RETURN
  21265.              without a GOSUB, or your batch file has been corrupted.
  21266.  
  21267.              Missing SETLOCAL:  An ENDLOCAL was used without a matching
  21268.              SETLOCAL.
  21269.  
  21270.              No aliases defined:  You tried to display aliases but no
  21271.              aliases have been defined.
  21272.  
  21273.              No closing quote:  4DOS, 4OS2, or 4DOS/NT couldn't find a
  21274.              second matching back-quote [`] or double-quote ["] on the
  21275.              command line.
  21276.  
  21277.              No expression:  The expression passed to the %@EVAL variable
  21278.              function is empty.  Correct the expression and retry the
  21279.              operation.
  21280.  
  21281.     4DOS     No file handle available:  This is an internal 4DOS disk
  21282.              swapping error.  Change to another swapping method if
  21283.              possible, and contact JP Software.
  21284.  
  21285.              No room for INI file name:  4DOS, 4OS2, or 4DOS/NT does not
  21286.              have enough space to pass the name of your .INI file
  21287.              to secondary shells; see String area overflow for more
  21288.              details.  Any
  21289.              [Secondary] section in 4DOS.INI will be ignored in secondary
  21290.              shells until the problem is corrected and the system or
  21291.              session is restarted.
  21292.  
  21293.  
  21294.  
  21295.         -------------------------------------------------------------------
  21296.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 366
  21297.                                                 APPENDIX A / ERROR MESSAGES
  21298.         -------------------------------------------------------------------
  21299.  
  21300.  
  21301.     4DOS     No UMBs; loading low:  The LOADHIGH (or LH) command can't find
  21302.              any UMBs for your program.  The program is loaded into base
  21303.              memory.  LH and LOADHIGH only work with MS-DOS 5.0 and above,
  21304.              when the DOS=UMB directive is included in CONFIG.SYS and
  21305.              sufficient upper memory space is available for the program.
  21306.  
  21307.     4DOS     No upper memory available, low memory will be used for
  21308.              [resident portion | master environment | global aliases |
  21309.              global history]:  You asked 4DOS to load the block of memory
  21310.              named in the message into a UMB via the corresponding
  21311.              directive in 4DOS.INI (UMBLoad, UMBEnvironment, etc.), but no
  21312.              UMB was available.  Check that your XMS driver is properly
  21313.              installed and/or free up some UMB space in use by another
  21314.              program.
  21315.  
  21316.     4DOS     Non-DOS disk:  DOS can't read the disk.  Either the disk is
  21317.              bad, or it has been formatted by a different operating system.
  21318.              Reformat it as a DOS disk.  Also see Data error above; the
  21319.              problems described there can sometimes cause a non-DOS disk
  21320.              error rather than a data error.
  21321.  
  21322.              Not an alias:  The specified alias is not in the alias list.
  21323.  
  21324.              Not in environment:  The specified variable is not in the
  21325.              environment.
  21326.  
  21327.     4DOS     Not in swapping mode:  You attempted to turn swapping on or
  21328.              off with the SWAPPING command, but 4DOS is loaded in non-
  21329.              swapping mode.
  21330.  
  21331.              Not ready:  The specified device can't be accessed.
  21332.  
  21333.              Not same device:  This error usually appears in RENAME.  You
  21334.              cannot rename a file to a different disk drive.
  21335.  
  21336.     4DOS     Out of environment/alias space:  4DOS has run out of space for
  21337.              environment variables or aliases.  Edit the SHELL line in
  21338.              CONFIG.SYS or the Environment directive in 4DOS.INI to
  21339.              increase the environment size, or the Alias directive in
  21340.              4DOS.INI to increase the alias list size.
  21341.  
  21342.              Out of memory:  The command processor or the operating system
  21343.              had insufficient memory to execute the last command, or under
  21344.              DOS, the memory control blocks have been destroyed.  If this
  21345.              error occurs in a 4DOS secondary shell, return to the primary
  21346.              shell before running the command.  Otherwise, try to free some
  21347.              memory by removing memory-resident programs (under DOS), or
  21348.              closing other sessions (under OS/2 and Windows NT).  If the
  21349.              error persists, contact JP Software for assistance.
  21350.  
  21351.  
  21352.         -------------------------------------------------------------------
  21353.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 367
  21354.                                                 APPENDIX A / ERROR MESSAGES
  21355.         -------------------------------------------------------------------
  21356.  
  21357.  
  21358.     4DOS     Under 4DOS, if the base memory (DOS RAM) figures reported by
  21359.              MEMORY are unreasonable, the memory control blocks have
  21360.              probably been destroyed and you must reboot the system or
  21361.              restart the session.  If you receive this error from DIR when
  21362.              MEMORY shows sufficient memory for the directory you are
  21363.              displaying, memory has probably been "fragmented," and
  21364.              contains a free area larger than 8K but not large enough for
  21365.              the entire directory.  Use a memory mapping program like PMAP,
  21366.              MAPMEM, or the DOS MEM utility to locate the fragmentation,
  21367.              and experiment with your TSRs and applications to determine
  21368.              and remove its cause.
  21369.  
  21370.              Out of paper:  The operating system detected an out-of-paper
  21371.              condition on one of the printers (LPT1, LPT2, or LPT3).  Check
  21372.              your printer and add paper if necessary.
  21373.  
  21374.              Overflow:  An arithmetic overflow occurred in the %@EVAL
  21375.              variable function.  Check the values being passed to %@EVAL.
  21376.              %@EVAL can handle 16 digits to the left of the decimal point
  21377.              and 8 to the right.
  21378.  
  21379.              Read error:  The operating system encountered a disk read
  21380.              error; usually caused by a bad or unformatted disk.
  21381.  
  21382.     4DOS     Region unavailable, using first available region for [resident
  21383.              portion | master environment | global aliases | global
  21384.              history]:  You used a 4DOS.INI directive to load the block of
  21385.              memory named in the message into a specific UMB region, but
  21386.              that region was unavailable.  Check the use of upper memory
  21387.              for device drivers and other programs loaded before 4DOS,
  21388.              and/or change the requested region number.
  21389.  
  21390.              Sector not found:  BIOS disk error, usually caused by a bad or
  21391.              unformatted disk.
  21392.  
  21393.              Seek error:  The operating system can't seek to the proper
  21394.              location on the disk.  This is generally caused by a bad disk
  21395.              or drive.
  21396.  
  21397.              Sharing violation:  You tried to access a file in use by
  21398.              another program in a multitasking system or on a network.
  21399.              Wait for the file to become available, or change your method
  21400.              of operation so that another program does not have the file
  21401.              open while you are trying to use it.
  21402.  
  21403.              String area overflow:  The command processor ran out of room
  21404.              to store the text from string directives in the .INI file.
  21405.              Reduce the complexity of the .INI file or contact JP Software
  21406.              for assistance.
  21407.  
  21408.  
  21409.         -------------------------------------------------------------------
  21410.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 368
  21411.                                                 APPENDIX A / ERROR MESSAGES
  21412.         -------------------------------------------------------------------
  21413.  
  21414.  
  21415.     4DOS     Swap file [seek | read | write] failed:  4DOS encountered an
  21416.              I/O error while accessing the disk swap file (4DOSSWAP.nnn or
  21417.              xxxxxxx.4SW).  The disk was changed, the file has been
  21418.              destroyed by a program, or 4DOS's memory area has been
  21419.              overwritten by another program.  Reboot the system or restart
  21420.              the session.
  21421.  
  21422.              Syntax error:  A command or variable function was entered in
  21423.              an improper format.  Check the syntax and correct the error.
  21424.  
  21425.     4DOS     Syntax error in region number or size:  You specified an
  21426.              invalid region number or size in the LH or LOADHIGH command.
  21427.              Correct the command.
  21428.  
  21429.     4DOS     Too many DR DOS SETs in CONFIG.SYS:  The SET commands in your
  21430.              DR DOS or Novell DOS CONFIG.SYS file exceeded the size of
  21431.              4DOS's buffer area.  Reduce the length of the commands or
  21432.              contact JP Software for assistance.
  21433.  
  21434.     4DOS,    Too many open files:  DOS or OS/2 has run out of file handles.
  21435.              Try increasing the
  21436.     4OS2     FILES setting in CONFIG.SYS.
  21437.  
  21438.     4DOS     Transient memory [allocation | deallocation] error:  4DOS
  21439.              could not reserve or release memory for its transient portion
  21440.              (probably in a SWAPPING OFF or SWAPPING ON command).  The
  21441.              memory control blocks have been destroyed, or a program has
  21442.              fragmented memory.  Reboot the system or restart the session.
  21443.  
  21444.              Unbalanced parentheses:  The number of left and right
  21445.              parentheses did not match in an expression passed to the
  21446.              %@EVAL variable function.  Correct the expression and retry
  21447.              the operation.
  21448.  
  21449.              Unknown command:  A command was entered that 4DOS, 4OS2, or
  21450.              4DOS/NT didn't recognize and couldn't find in the current
  21451.              search path.  Check the spelling or PATH specification.  You
  21452.              can handle unknown commands with the UNKNOWN_CMD alias (see
  21453.                   171             page    ).
  21454.  
  21455.              Variable loop:  A nested environment variable refers to
  21456.              itself, or variables are nested more than 16 deep.  Correct
  21457.              the error and retry the command.
  21458.  
  21459.     4OS2,    Window title not found:  The ACTIVATE or WINDOW command cannot
  21460.              find a
  21461.     4NT      window with the title you specified.  Correct the command and
  21462.              try again.
  21463.  
  21464.  
  21465.  
  21466.         -------------------------------------------------------------------
  21467.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 369
  21468.                                                 APPENDIX A / ERROR MESSAGES
  21469.         -------------------------------------------------------------------
  21470.  
  21471.  
  21472.              Write error:  The operating system encountered a disk write
  21473.              error; usually caused by a bad or unformatted disk.
  21474.  
  21475.     4DOS     XMS deallocation failed:  4DOS could not deallocate XMS memory
  21476.              when exiting a secondary shell.  XMS memory has been
  21477.              destroyed; reboot the system or restart the session.
  21478.  
  21479.     4DOS     XMS move failed:  4DOS could not move data between base memory
  21480.              and XMS memory while swapping itself.  XMS memory has been
  21481.              destroyed; reboot the system or restart the session.
  21482.  
  21483.  
  21484.  
  21485.  
  21486.  
  21487.  
  21488.  
  21489.  
  21490.  
  21491.  
  21492.  
  21493.  
  21494.  
  21495.  
  21496.  
  21497.  
  21498.  
  21499.  
  21500.  
  21501.  
  21502.  
  21503.  
  21504.  
  21505.  
  21506.  
  21507.  
  21508.  
  21509.  
  21510.  
  21511.  
  21512.  
  21513.  
  21514.  
  21515.  
  21516.  
  21517.  
  21518.  
  21519.  
  21520.  
  21521.  
  21522.  
  21523.         -------------------------------------------------------------------
  21524.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 370
  21525.                                            APPENDIX B / ASCII AND KEY CODES
  21526.         -------------------------------------------------------------------
  21527.  
  21528.  
  21529.  
  21530.         APPENDIX B / ASCII AND KEY CODES
  21531.  
  21532.  
  21533.         The tables in this section are based on U.S. English conventions.
  21534.         Your system may differ if it is configured for a different country
  21535.         or language.  See your operating system documentation for more
  21536.         information about country and language support.
  21537.  
  21538.  
  21539.         ASCII
  21540.  
  21541.              To represent the text you type, computers must translate each
  21542.              letter to and from a number.  The code used by all PC-
  21543.              compatible computers for this translation is called ASCII
  21544.              (American Standard Code for Information Interchange).
  21545.              Function keys, cursor keys, and Alt keys do not generate ASCII
  21546.              codes.  For details on these keys and a reference table, see
  21547.              Keys and Key Codes later in this Appendix.
  21548.  
  21549.              The ASCII table on the following pages is in three parts.
  21550.              Each part is described below.  The first two parts cover the
  21551.              128 standard ASCII characters; the third covers the 128
  21552.              extended ASCII characters used on the IBM PC and compatible
  21553.              computers.  All the tables include a Char column showing the
  21554.              visual representation of the character, a Dec column showing
  21555.              the decimal numeric value of the character in the ASCII set,
  21556.              and a Hex column showing the hexadecimal (base-16) value.
  21557.  
  21558.              ASCII Control Characters have numeric values between 0 and 31,
  21559.              and include non-printing characters like carriage return and
  21560.              line feed.  The ASCII standard does not define a visual
  21561.              representation for these characters, but the IBM PC character
  21562.              set does define one for most control characters as shown in
  21563.              the Char column of the table.  You can enter these characters
  21564.              using the key combination shown in the Ctrl column, with a
  21565.              caret [^] representing the Ctrl key.  For example, to enter
  21566.              character 4, the diamond symbol (^D), press the Ctrl and D
  21567.              keys together.  You can also enter control characters with the
  21568.              Alt key and the numeric keypad, like extended ASCII codes (see
  21569.              below).  The Name column shows a two or three character "name"
  21570.              given to each control character as part of the ASCII standard.
  21571.  
  21572.              ASCII Printing Characters have numeric values between 32 and
  21573.              127, and include the entire English-language character set as
  21574.              well as punctuation and other special marks.  You enter these
  21575.              characters by pressing the corresponding keyboard key.
  21576.              Character 127 has no keyboard key, but can be entered on many
  21577.              systems by typing Ctrl-Backspace.
  21578.  
  21579.  
  21580.         -------------------------------------------------------------------
  21581.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 371
  21582.                                            APPENDIX B / ASCII AND KEY CODES
  21583.         -------------------------------------------------------------------
  21584.  
  21585.  
  21586.              Extended ASCII Characters have values between 128 and 255 and
  21587.              include international language characters, line-drawing
  21588.              characters, and other symbols.  You can enter extended ASCII
  21589.              codes (or other character codes) on the keyboard by holding
  21590.              down the Alt key, entering the decimal numeric value of the
  21591.              key on the numeric keypad, and then releasing the Alt key.
  21592.  
  21593.  
  21594.  
  21595.  
  21596.  
  21597.  
  21598.  
  21599.  
  21600.  
  21601.  
  21602.  
  21603.  
  21604.  
  21605.  
  21606.  
  21607.  
  21608.  
  21609.  
  21610.  
  21611.  
  21612.  
  21613.  
  21614.  
  21615.  
  21616.  
  21617.  
  21618.  
  21619.  
  21620.  
  21621.  
  21622.  
  21623.  
  21624.  
  21625.  
  21626.  
  21627.  
  21628.  
  21629.  
  21630.  
  21631.  
  21632.  
  21633.  
  21634.  
  21635.  
  21636.  
  21637.         -------------------------------------------------------------------
  21638.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 372
  21639.                                            APPENDIX B / ASCII AND KEY CODES
  21640.         -------------------------------------------------------------------
  21641.  
  21642.  
  21643.  
  21644.  
  21645.  
  21646.  
  21647.  
  21648.  
  21649.  
  21650.  
  21651.  
  21652.  
  21653.  
  21654.  
  21655.  
  21656.  
  21657.  
  21658.  
  21659.  
  21660.  
  21661.  
  21662.  
  21663.  
  21664.  
  21665.  
  21666.  
  21667.  
  21668.  
  21669.  
  21670.  
  21671.  
  21672.  
  21673.  
  21674.  
  21675.  
  21676.  
  21677.  
  21678.  
  21679.  
  21680.  
  21681.  
  21682.  
  21683.  
  21684.  
  21685.  
  21686.  
  21687.  
  21688.  
  21689.  
  21690.  
  21691.  
  21692.  
  21693.  
  21694.         -------------------------------------------------------------------
  21695.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 373
  21696.                                            APPENDIX B / ASCII AND KEY CODES
  21697.         -------------------------------------------------------------------
  21698.  
  21699.  
  21700.  
  21701.  
  21702.  
  21703.  
  21704.  
  21705.  
  21706.  
  21707.  
  21708.  
  21709.  
  21710.  
  21711.  
  21712.  
  21713.  
  21714.  
  21715.  
  21716.  
  21717.  
  21718.  
  21719.  
  21720.  
  21721.  
  21722.  
  21723.  
  21724.  
  21725.  
  21726.  
  21727.  
  21728.  
  21729.  
  21730.  
  21731.  
  21732.  
  21733.  
  21734.  
  21735.  
  21736.  
  21737.  
  21738.  
  21739.  
  21740.  
  21741.  
  21742.  
  21743.  
  21744.  
  21745.  
  21746.  
  21747.  
  21748.  
  21749.  
  21750.  
  21751.         -------------------------------------------------------------------
  21752.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 374
  21753.                                            APPENDIX B / ASCII AND KEY CODES
  21754.         -------------------------------------------------------------------
  21755.  
  21756.  
  21757.  
  21758.         Keys and Key Codes
  21759.  
  21760.              When you press a single key or a key combination, software
  21761.              built into your computer (the BIOS or Basic Input / Output
  21762.              System) translates your keystroke into two numbers:  a scan
  21763.              code, representing the actual key that was pressed, and an
  21764.              ASCII code, representing the ASCII value for that key.  The
  21765.              BIOS returns these numbers the next time a program requests
  21766.              keyboard input.  This section explains how key codes work; for
  21767.              information on using them with 4DOS, 4OS2, and 4DOS/NT see the
  21768.              .INI file (page 143), keystroke aliases (page 165), INKEY
  21769.                    259             (page    ), and KEYSTACK (page 266).
  21770.  
  21771.              Most 4DOS, 4OS2, and 4DOS/NT commands that use the numeric key
  21772.              codes listed here also use key names, which are usually more
  21773.              convenient to use than the numeric codes.  See page 31 for
  21774.              more information on key names.
  21775.  
  21776.              As PCs have evolved, the structure of keyboard codes has
  21777.              evolved somewhat haphazardly with them, resulting in a
  21778.              bewildering array of possible key codes.  We'll give you a
  21779.              basic explanation of how key codes work.  For a more in-depth
  21780.              discussion, refer to a BIOS or PC hardware reference manual.
  21781.  
  21782.              The nuances of how your keyboard behaves depends on the
  21783.              keyboard manufacturer, the computer manufacturer who provides
  21784.              the built-in BIOS, and your operating system.  As a result, we
  21785.              can't guarantee the accuracy of the information below for
  21786.              every system, but the discussion and reference table should be
  21787.              accurate for most systems.  Our discussion is based on the
  21788.              101-key "enhanced" keyboard commonly used on 286, 386, 486,
  21789.              and Pentium computers, but virtually all of it is applicable
  21790.              to the 84-key keyboards on older systems.  The primary
  21791.              difference is that older keyboards lack a separate cursor pad
  21792.              and only have 10 function keys.
  21793.  
  21794.              All keys have a scan code, but not all have an ASCII code.
  21795.              For example, function keys and cursor keys are not part of the
  21796.              ASCII character set (see page 371) and have no ASCII value,
  21797.              but they do have a scan code.  Some keys have more than one
  21798.              ASCII code.  The A, for example, has ASCII code 97 (lower case
  21799.              "a") if you press it by itself.  If you press it along with
  21800.              Shift, the ASCII code changes to 65 (upper case "A").  If you
  21801.              press Ctrl and A the ASCII code changes to 1.  In all these
  21802.              cases, the scan code (30) is unchanged because you are
  21803.              pressing the same physical key.
  21804.  
  21805.              Things are different if you press Alt-A.  Alt keystrokes have
  21806.              no ASCII code, so the BIOS returns an ASCII code of 0, along
  21807.  
  21808.         -------------------------------------------------------------------
  21809.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 375
  21810.                                            APPENDIX B / ASCII AND KEY CODES
  21811.         -------------------------------------------------------------------
  21812.  
  21813.  
  21814.              with the A key's scan code of 30.  This allows a program to
  21815.              detect all the possible variations of A, based on the
  21816.              combination of ASCII code and scan code.
  21817.  
  21818.              Some keys generate more than one scan code depending on
  21819.              whether Shift, Ctrl, or Alt is pressed.  This allows a program
  21820.              to differentiate between two different keystrokes on the same
  21821.              key, neither of which has a corresponding ASCII value.  For
  21822.              example, F1 has no ASCII value so it returns an ASCII code of
  21823.              0, and the F1 scan code of 59.  Shift-F1 also returns an ASCII
  21824.              code 0; if it also returned a scan code of 59, a program
  21825.              couldn't distinguish it from F1.  The BIOS or operating system
  21826.              translates scan codes for keys like Shift-F1 (and Ctrl-F1 and
  21827.              Alt-F1) so that each variation returns a different scan code
  21828.              along with an ASCII code of 0.
  21829.  
  21830.              On the 101-key keyboard there's one more variation:  non-ASCII
  21831.              keys on the cursor keypad (such as up-arrow) return the same
  21832.              scan code as the corresponding key on the numeric keypad, for
  21833.              compatibility reasons.  If they also returned an ASCII code of
  21834.              0, a program couldn't tell which key was pressed.  Therefore,
  21835.              these keys return an ASCII code of 224 rather than 0.  This
  21836.              means that older programs, which only look for an ASCII 0 to
  21837.              indicate a non-ASCII keystroke like up-arrow, may not detect
  21838.              these cursor pad keys properly.
  21839.  
  21840.              The number of different codes returned by any given key varies
  21841.              from one (for the spacebar) to four, depending on the key, the
  21842.              design of your keyboard, and the BIOS or operating system.
  21843.              Some keys, like Alt, Ctrl, and Shift by themselves or in
  21844.              combination with each other, plus Print Screen, SysReq, Scroll
  21845.              Lock, Pause, Break, Num Lock, and Caps Lock keys, do not have
  21846.              any code representations at all.  The same is true of
  21847.              keystrokes with more than one modifying key, like Ctrl-Shift-
  21848.              A.  The BIOS or operating system may perform special actions
  21849.              automatically when you press these keys (for example, it
  21850.              switches into Caps Lock mode when you press Caps Lock), but it
  21851.              does not report the keystrokes to whatever program is running.
  21852.              Programs which detect such keystrokes access the keyboard
  21853.              hardware directly, a subject which is beyond the scope of this
  21854.              manual.
  21855.  
  21856.              The following table lists all of the keys on the 101-key
  21857.              "enhanced" keyboard.  The keys are arranged roughly in scan
  21858.              code order, which is generally left to right, moving from the
  21859.              top of the keyboard to the bottom.
  21860.  
  21861.              Column 1 shows the key's keycap symbol or name.  Columns 2 and
  21862.              3 show the scan code, and the ASCII code if the key is
  21863.              unshifted.  Columns 4 and 5 contain the codes for the shifted
  21864.  
  21865.         -------------------------------------------------------------------
  21866.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 376
  21867.                                            APPENDIX B / ASCII AND KEY CODES
  21868.         -------------------------------------------------------------------
  21869.  
  21870.  
  21871.              key.  Columns 6 and 7 show the codes for Ctrl plus the key.
  21872.              The last column contains the scan code for Alt plus the key
  21873.              (Alt keystrokes have no ASCII code and always generate an
  21874.              ASCII code of 0, which is not shown).
  21875.  
  21876.              Key names prefaced by np are on the numeric keypad.  Those
  21877.              prefaced by cp are on the cursor keypad between the main
  21878.              typing keys and the number keypad.  The numeric keypad values
  21879.              are valid if Num Lock is turned off.  If you need to specify a
  21880.              number key from the numeric keypad, use the scan code shown
  21881.              for the keypad and the ASCII code shown for the corresponding
  21882.              typewriter key.  For example, the keypad "7" has a scan code
  21883.              of 71 (the np Home scan code) and an ASCII code of 54 (the
  21884.              ASCII code for "7").
  21885.  
  21886.              The chart is blank for key combinations that are not reported
  21887.              at all by the BIOS, like Ctrl-1 and Alt-PgUp.
  21888.  
  21889.  
  21890.  
  21891.  
  21892.  
  21893.  
  21894.  
  21895.  
  21896.  
  21897.  
  21898.  
  21899.  
  21900.  
  21901.  
  21902.  
  21903.  
  21904.  
  21905.  
  21906.  
  21907.  
  21908.  
  21909.  
  21910.  
  21911.  
  21912.  
  21913.  
  21914.  
  21915.  
  21916.  
  21917.  
  21918.  
  21919.  
  21920.  
  21921.  
  21922.         -------------------------------------------------------------------
  21923.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 377
  21924.                                            APPENDIX B / ASCII AND KEY CODES
  21925.         -------------------------------------------------------------------
  21926.  
  21927.  
  21928.  
  21929.                    Scan Codes and Key Codes for Top Two Keyboard Rows
  21930.  
  21931.                                      Shift  Shift  Ctrl   Ctrl   Alt
  21932.             Key Cap    Scan   ASCII  Scan   ASCII  Scan   ASCII  Scan
  21933.             Symbol     Code   Code   Code   Code   Code   Code   Code
  21934.             
  21935.             Esc        1      27     1      27     1      27     1
  21936.             1  !       2      49     2      33                   120
  21937.             2  @       3      50     3      64     3      0      121
  21938.             3  #       4      51     4      35                   122
  21939.             4  $       5      52     5      36                   123
  21940.             5  %       6      53     6      37                   124
  21941.             6  ^       7      54     7      94     7      30     125
  21942.             7  &       8      55     8      38                   126
  21943.             8  *       9      56     9      42                   127
  21944.             9  (       10     57     10     40                   128
  21945.             0  )       11     48     11     41                   129
  21946.             -  _       12     45     12     95     12     31     130
  21947.             =  +       13     61     13     43                   131
  21948.             Backspace  14     8      14     8      14     127    14
  21949.             Tab        15     9      15     0      148    0      165
  21950.             Q          16     113    16     81     16     17     16
  21951.             W          17     119    17     87     17     23     17
  21952.             E          18     101    18     69     18     5      18
  21953.             R          19     114    19     82     19     18     19
  21954.             T          20     116    20     84     20     20     20
  21955.             Y          21     121    21     89     21     25     21
  21956.             U          22     117    22     85     22     21     22
  21957.             I          23     105    23     73     23     9      23
  21958.             O          24     111    24     79     24     15     24
  21959.             P          25     112    25     80     25     16     25
  21960.             [  {       26     91     26     123    26     27     26
  21961.             ]  }       27     93     27     125    27     29     27
  21962.             Enter      28     13     28     13     28     10     28
  21963.  
  21964.  
  21965.  
  21966.  
  21967.  
  21968.  
  21969.  
  21970.  
  21971.  
  21972.  
  21973.  
  21974.  
  21975.  
  21976.  
  21977.  
  21978.  
  21979.         -------------------------------------------------------------------
  21980.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 378
  21981.                                            APPENDIX B / ASCII AND KEY CODES
  21982.         -------------------------------------------------------------------
  21983.  
  21984.  
  21985.  
  21986.                  Scan Codes and Key Codes for Bottom Two Keyboard Rows
  21987.  
  21988.                                      Shift  Shift  Ctrl   Ctrl   Alt
  21989.             Key Cap    Scan   ASCII  Scan   ASCII  Scan   ASCII  Scan
  21990.             Symbol     Code   Code   Code   Code   Code   Code   Code
  21991.  
  21992.             A          30     97     30     65     30     1      30
  21993.             S          31     115    31     83     31     19     31
  21994.             D          32     100    32     68     32     4      32
  21995.             F          33     102    33     70     33     6      33
  21996.             G          34     103    34     71     34     7      34
  21997.             H          35     104    35     72     35     8      35
  21998.             J          36     106    36     74     36     10     36
  21999.             K          37     107    37     75     37     11     37
  22000.             L          38     108    38     76     38     12     38
  22001.             ; :        39     59     39     58                   39
  22002.             '  "       40     39     40     34                   40
  22003.             `  ~       41     96     41     126                  41
  22004.             \  |       43     92     43     124    43     28     43
  22005.             Z          44     122    44     90     44     26     44
  22006.             X          45     120    45     88     45     24     45
  22007.             C          46     99     46     67     46     3      46
  22008.             V          47     118    47     86     47     22     47
  22009.             B          48     98     48     66     48     2      48
  22010.             N          49     110    49     78     49     14     49
  22011.             M          50     109    50     77     50     13     50
  22012.             ,  <       51     44     51     60                   51
  22013.             .  >       52     46     52     62                   52
  22014.             /  ?       53     47     53     63                   53
  22015.             Space      57     32     57     32     57     32     57
  22016.  
  22017.  
  22018.  
  22019.  
  22020.  
  22021.  
  22022.  
  22023.  
  22024.  
  22025.  
  22026.  
  22027.  
  22028.  
  22029.  
  22030.  
  22031.  
  22032.  
  22033.  
  22034.  
  22035.  
  22036.         -------------------------------------------------------------------
  22037.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 379
  22038.                                            APPENDIX B / ASCII AND KEY CODES
  22039.         -------------------------------------------------------------------
  22040.  
  22041.  
  22042.                 Scan Codes and Key Codes for Key Pads and Function Keys
  22043.  
  22044.                                      Shift  Shift  Ctrl   Ctrl   Alt
  22045.             Key Cap    Scan   ASCII  Scan   ASCII  Scan   ASCII  Scan
  22046.             Symbol     Code   Code   Code   Code   Code   Code   Code
  22047.  
  22048.             F1         59     0      84     0      94     0      104
  22049.             F2         60     0      85     0      95     0      105
  22050.             F3         61     0      86     0      96     0      106
  22051.             F4         62     0      87     0      97     0      107
  22052.             F5         63     0      88     0      98     0      108
  22053.             F6         64     0      89     0      99     0      109
  22054.             F7         65     0      90     0      100    0      110
  22055.             F8         66     0      91     0      101    0      111
  22056.             F9         67     0      92     0      102    0      112
  22057.             F10        68     0      93     0      103    0      113
  22058.             F11        133    0      135    0      137    0      139
  22059.             F12        134    0      136    0      138    0      140
  22060.             np *       55     42     55     42     150    0      55
  22061.             np Home    71     0      71     55     119    0      
  22062.             cp Home    71     224    71     224    119    224    151
  22063.             np Up      72     0      72     56     141    0      
  22064.             cp Up      72     224    72     224    141    224    152
  22065.             np PgUp    73     0      73     57     132    0      
  22066.             cp PgUp    73     224    73     224    132    224    153
  22067.             np Minus   74     45     74     45     142    0      74
  22068.             np Left    75     0      75     52     115    0      
  22069.             cp Left    75     224    75     224    115    224    155
  22070.             np 5       76     0      76     53     143    0      
  22071.             np Right   77     0      77     54     116    0      
  22072.             cp Right   77     224    77     224    116    224    157
  22073.             np Plus    78     43     78     43     144    0      78
  22074.             np End     79     0      79     49     117    0      
  22075.             cp End     79     224    79     224    117    224    159
  22076.             np Down    80     0      80     50     145    0      
  22077.             cp Down    80     224    80     224    145    224    160
  22078.             np PgDn    81     0      81     51     118    0      
  22079.             cp PgDn    81     224    81     224    118    224    161
  22080.             np Ins     82     0      82     48     146    0      
  22081.             cp Ins     82     224    82     224    146    224    162
  22082.             np Del     83     0      83     46     147    0      
  22083.             cp Del     83     224    83     224    147    224    163
  22084.             np /       224    47     224    47     149    0      164
  22085.             np Enter   224    13     224    13     224    10     166
  22086.  
  22087.  
  22088.  
  22089.  
  22090.  
  22091.  
  22092.  
  22093.  
  22094.         -------------------------------------------------------------------
  22095.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 380
  22096.                                                                    GLOSSARY
  22097.         -------------------------------------------------------------------
  22098.  
  22099.  
  22100.  
  22101.         GLOSSARY
  22102.  
  22103.  
  22104.         Some items in this glossary refer to features or to terms which are
  22105.         discussed in more detail elsewhere in this manual.  Be sure to
  22106.         check the index to see if more information is available on a
  22107.         particular feature or term.
  22108.  
  22109.              4EXIT:  A batch file which is executed whenever a secondary
  22110.              4DOS, 4OS2, or 4DOS/NT shell ends.
  22111.  
  22112.              4START:  A batch file which is executed whenever 4DOS, 4OS2,
  22113.              or 4DOS/NT is started, either as a primary shell or a
  22114.              secondary shell.
  22115.  
  22116.              Alias:  A shorthand name for a command or series of commands.
  22117.  
  22118.              Alias Parameter:  A numbered variable (e.g. %2) included in an
  22119.              alias definition, allowing a different value to be used in the
  22120.              alias each time it is executed.
  22121.  
  22122.              AND:  A logical combination of two true or false conditions.
  22123.              If both conditions are true, the result is true; if either
  22124.              condition is false, the result is false.
  22125.  
  22126.              ANSI.SYS:  A device driver supplied with DOS which provides
  22127.              enhanced screen display and keyboard macros, or one of the
  22128.              many similar programs.
  22129.  
  22130.              APM:  A standardized system used by manufacturers of battery-
  22131.              powered computers to report battery status and control power
  22132.              management features.
  22133.  
  22134.              Append:  Concatenation of one file or string onto the end of
  22135.              another (this use is not related to the DOS and OS/2 external
  22136.              command named APPEND).
  22137.  
  22138.              Application:  A program run from the command prompt or a batch
  22139.              file.  Used broadly to mean any program other than the command
  22140.              processor; and more narrowly to mean a program with a specific
  22141.              purpose such as a spreadsheet or word processing program, as
  22142.              opposed to a utility.
  22143.  
  22144.              Archive:  A file attribute indicating that the file has been
  22145.              modified since the last backup (most backup programs clear
  22146.              this attribute).  Also sometimes refers to a single file (such
  22147.              as a .ZIP file) which contains a number of other files in
  22148.              compressed form.
  22149.  
  22150.  
  22151.         -------------------------------------------------------------------
  22152.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 381
  22153.                                                                    GLOSSARY
  22154.         -------------------------------------------------------------------
  22155.  
  22156.  
  22157.              Argument:  See Parameter.
  22158.  
  22159.              ASCII:  The American Standard Code for Information
  22160.              Interchange, which defines numeric values for 128 different
  22161.              characters comprising the English alphabet, numbers,
  22162.              punctuation, and some control characters.
  22163.  
  22164.              ASCII File:  A file containing ASCII text, as opposed to a
  22165.              binary file which may contain numbers, or other information
  22166.              that cannot be sensibly interpreted as text.
  22167.  
  22168.              Attribute:  A characteristic of a file which can be set or
  22169.              cleared.  The standard attributes are Read-Only, Hidden,
  22170.              System, and Archive.
  22171.  
  22172.              Automatic Directory Change:  A 4DOS, 4OS2, and 4DOS/NT feature
  22173.              which allows you to change directories by typing the directory
  22174.              name and a backslash [\] at the prompt.
  22175.  
  22176.              Base Memory:  Under DOS, the portion of your computer's memory
  22177.              available for use by DOS, the command processor, and
  22178.              application programs.  On most PCs this area consists of the
  22179.              first 640K or 655,360 bytes of the computer's memory.
  22180.  
  22181.              Base Name:  The file name without a drive, path, or extension.
  22182.              For example, in the file name C:\DIR1\LETTER.DAT the base name
  22183.              is LETTER.
  22184.  
  22185.              BAT File:  Same as a Batch File.
  22186.  
  22187.              Batch File:  A text file containing a sequence of commands for
  22188.              the command processor to execute.  Batch files are used to
  22189.              save command sequences so that they can be re-executed at any
  22190.              time, transferred to another system, etc.
  22191.  
  22192.              Batch File Parameter:  A numbered variable (e.g. %2) used
  22193.              within a batch file, allowing a different value to be used at
  22194.              that spot in the file each time it is executed.
  22195.  
  22196.              Binary File:  A file containing information which does not
  22197.              represent or cannot sensibly be interpreted as text.  See also
  22198.              ASCII File.
  22199.  
  22200.              Block Device:  A physical device for input or output which can
  22201.              transmit or receive large blocks of data while the computer is
  22202.              engaged in other activities.  Examples include disk, tape, and
  22203.              CD-ROM drives.  See also Character Device.
  22204.  
  22205.              Boot:  The process of starting the computer and loading the
  22206.              operating system into memory.
  22207.  
  22208.         -------------------------------------------------------------------
  22209.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 382
  22210.                                                                    GLOSSARY
  22211.         -------------------------------------------------------------------
  22212.  
  22213.  
  22214.              Boot Directory:  The current directory at the time the system
  22215.              is booted, usually the root directory of the boot drive.
  22216.  
  22217.              Boot Drive:  The disk drive that the system is booted from,
  22218.              usually A: (the floppy disk) or C: (the hard disk).
  22219.  
  22220.              Break:  A signal sent to a program to tell it to halt what it
  22221.              is doing.  The Ctrl-C key  or Ctrl-Break key is used to send
  22222.              this signal.  Some external commands abort when they receive a
  22223.              break signal; others return to a previous screen or menu, or
  22224.              abort the current operation.
  22225.  
  22226.              BTM File:  A special type of batch file which is loaded into
  22227.              memory to speed up execution.
  22228.  
  22229.              Buffer:  An area of memory set aside for storage.  For
  22230.              example, disk buffers are used to save information as it is
  22231.              transferred between your program and the disk, and the
  22232.              keyboard buffer holds keystrokes until a program can use them.
  22233.  
  22234.              Character Device:  A physical device for input or output which
  22235.              must communicate with your computer one character at a time.
  22236.              Examples include the console, communications ports, and
  22237.              printers.  See also Block Device.
  22238.  
  22239.              Code Page:  A set of definitions which tells DOS or OS/2 how
  22240.              to get and display date, time, and other information in the
  22241.              format appropriate to a particular country.
  22242.  
  22243.              Command Completion:  A 4DOS, 4OS2, and 4DOS/NT feature which
  22244.              allows you to recall a previous command by typing the first
  22245.              few letters of the command, then an up-arrow or down-arrow.
  22246.  
  22247.              Command Echoing:  A feature which displays commands as they
  22248.              are executed.  Echoing can be turned on and off.
  22249.  
  22250.              Command History:  A 4DOS, 4OS2, and 4DOS/NT feature which
  22251.              retains commands you have executed, so that they can be
  22252.              modified and re-executed later.
  22253.  
  22254.              Command History Window:  A pop-up window used by 4DOS, 4OS2,
  22255.              and 4DOS/NT to display the command history, allowing you to
  22256.              choose a previous command to modify and/or execute.
  22257.  
  22258.              Command Processor:  A program which interprets commands and
  22259.              executes other programs.  Sometimes also called a Command
  22260.              Interpreter.
  22261.  
  22262.              Command Recall:  See Command History.
  22263.  
  22264.  
  22265.         -------------------------------------------------------------------
  22266.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 383
  22267.                                                                    GLOSSARY
  22268.         -------------------------------------------------------------------
  22269.  
  22270.  
  22271.              Command Tail:  The portion of a command consisting of all the
  22272.              arguments, i.e., everything but the command name itself.
  22273.  
  22274.              Compound Command:  See Multiple Commands.
  22275.  
  22276.              COMSPEC:  An environment variable which defines where to find
  22277.              the command processor to start a secondary shell.
  22278.  
  22279.              Conditional Commands:  A 4DOS, 4OS2, and 4DOS/NT feature
  22280.              allowing commands to be executed or skipped depending on the
  22281.              results of a previous command.   See also Exit Code.
  22282.  
  22283.              Console:  The PC keyboard and display.
  22284.  
  22285.              Control Character:  A character which is part of the ASCII
  22286.              code, but does not have a normal text representation, and
  22287.              which can be generated by pressing the Ctrl key along with
  22288.              another key.
  22289.  
  22290.              Country Code:  See Code Page.
  22291.  
  22292.              CPU:  The Central Processing Unit which performs all logic and
  22293.              calculations in a computer.  In PC-compatible systems, the CPU
  22294.              is on a single microprocessor chip.
  22295.  
  22296.              CR:  The ASCII character "carriage return", generated by
  22297.              pressing the Enter key on the keyboard, and stored in most
  22298.              ASCII files at the end of each line.
  22299.  
  22300.              Critical Error:  An error, usually related to a physical or
  22301.              hardware problem with input, output, or network access, which
  22302.              prevents a program from continuing.
  22303.  
  22304.              Current Directory:  The directory in which all file operations
  22305.              will take place unless otherwise specified.
  22306.  
  22307.              Date Range:  A 4DOS, 4OS2, and 4DOS/NT feature which allows
  22308.              you to select files based on the date and time they were last
  22309.              modified.
  22310.  
  22311.              Description:  A string of characters assigned to describe a
  22312.              file with the 4DOS, 4OS2, or 4DOS/NT DESCRIBE command.
  22313.  
  22314.              Destination:  In file processing commands (e.g. COPY or MOVE),
  22315.              the name or directory files should have after any copying or
  22316.              modification has taken place, generally the last specification
  22317.              on the command line.  See also Source.
  22318.  
  22319.              Device:  A physical device for input or output such as the
  22320.              console, a communications port, or a printer.  Sometimes
  22321.  
  22322.         -------------------------------------------------------------------
  22323.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 384
  22324.                                                                    GLOSSARY
  22325.         -------------------------------------------------------------------
  22326.  
  22327.  
  22328.              "device" is used to refer to character devices, and excludes
  22329.              block devices.
  22330.  
  22331.              Device Driver:  A program which allows the operating system to
  22332.              communicate with a device, and which is loaded into memory
  22333.              when the system boots.  Device drivers are also used to manage
  22334.              memory or for other similar internal functions.
  22335.  
  22336.              Directory:  A portion of any disk, identified by a name and a
  22337.              relationship to other directories in a "tree" structure, with
  22338.              the tree starting at the root directory.  A directory
  22339.              separates files on the disk into logical groups, but does not
  22340.              represent a physical division of the data on the disk.
  22341.  
  22342.              Directory History:  A 4DOS, 4OS2, and 4DOS/NT feature which
  22343.              allows you to recall recently-used directory names in a window
  22344.              and choose one to switch to.
  22345.  
  22346.              Disk Swapping:  A type of swapping in which the transient
  22347.              portion of 4DOS is stored on disk while an application is
  22348.              running.
  22349.  
  22350.              DOS Memory:  See Base Memory.
  22351.  
  22352.              DOS Session:  See Session.
  22353.  
  22354.              Echo:  See Command Echoing.
  22355.  
  22356.              EMS Memory:  Under DOS, memory which conforms to the Lotus /
  22357.              Intel / Microsoft Expanded Memory Specification (LIM EMS),
  22358.              which allows programs to access large amounts of memory
  22359.              outside of base memory or extended memory.
  22360.  
  22361.              EMS Swapping:  A type of swapping in which the transient
  22362.              portion of 4DOS is stored in EMS memory while an application
  22363.              is running.
  22364.  
  22365.              Environment:  An area of memory which contains multiple
  22366.              entries in the form "NAME=value".  See also Master Environment
  22367.              and Passed Environment.
  22368.  
  22369.              Environment Variable:  The name of a single entry in the
  22370.              environment.
  22371.  
  22372.              Errorlevel:  A numeric value between 0 and 255 returned from
  22373.              an external command to indicate its result (e.g., success,
  22374.              failure, response to a question).  See also Exit Code.
  22375.  
  22376.              Escape Character:  In some contexts, the 4DOS, 4OS2, or
  22377.              4DOS/NT escape character, which is used to suppress the normal
  22378.  
  22379.         -------------------------------------------------------------------
  22380.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 385
  22381.                                                                    GLOSSARY
  22382.         -------------------------------------------------------------------
  22383.  
  22384.  
  22385.              meaning of or give special meaning to the following character.
  22386.              In other cases, the specific ASCII character ESC.  The meaning
  22387.              must be determined from the context.
  22388.  
  22389.              Executable Extensions:  A 4DOS, 4OS2, and 4DOS/NT feature
  22390.              which allows you to specify the application to be executed
  22391.              when a file with a particular extension is named at the
  22392.              command prompt.
  22393.  
  22394.              Executable File:  A file, usually with the extension .COM or
  22395.              .EXE, which can be loaded into memory and run as a program.
  22396.  
  22397.              Exit Code:  The result code returned by an external command or
  22398.              an internal command.  4DOS, 4OS2, and 4DOS/NT internal
  22399.              commands return an exit code of 0 if successful, or non-zero
  22400.              if unsuccessful.  See also Errorlevel.
  22401.  
  22402.              Expansion:  The process 4DOS, 4OS2, and 4DOS/NT go through
  22403.              when they scan a command line and substitute the appropriate
  22404.              actual values for aliases, alias parameters, batch file
  22405.              parameters, and environment variables.  See also Parsing.
  22406.  
  22407.              Extended ASCII Character:  A character which is not part of
  22408.              the standard set of 128 ASCII characters, but is used on the
  22409.              PC as part of an extended set of 256 characters.  These
  22410.              characters include international language symbols, and box and
  22411.              line drawing characters.
  22412.  
  22413.              Extended Memory:  Any memory on a 286-based (PC-AT
  22414.              compatible), 386, 486, or Pentium-based computer system which
  22415.              is above the 1 MB (one megabyte, or 1024*1024 bytes) of memory
  22416.              that DOS can address directly.  See also XMS.
  22417.  
  22418.              Extended Parent Directory Names:  A 4DOS, 4OS2, and 4DOS/NT
  22419.              feature which allows you to use additional periods in a
  22420.              directory name to represent directories which are successively
  22421.              higher in the directory tree.
  22422.  
  22423.              Extended Wildcard:  A 4DOS, 4OS2, and 4DOS/NT feature which
  22424.              allows you to use multiple wildcard characters, extending the
  22425.              traditional wildcard syntax.  See also Wildcard.
  22426.  
  22427.              Extension:  The final portion of a file name, preceded by a
  22428.              period.  For example, in the file name C:\DIR1\LETTER.DAT the
  22429.              extension is .DAT.
  22430.  
  22431.              External Command:  A program which resides in an executable
  22432.              file, as opposed to an internal command which is part of the
  22433.              command processor.
  22434.  
  22435.  
  22436.         -------------------------------------------------------------------
  22437.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 386
  22438.                                                                    GLOSSARY
  22439.         -------------------------------------------------------------------
  22440.  
  22441.  
  22442.              FAT File System:  The traditional file system used by DOS to
  22443.              store files on diskettes and hard disks; also supported by
  22444.              OS/2 and Windows NT.  Uses a File Allocation Table to keep
  22445.              track of allocated and unallocated space on the disk.
  22446.  
  22447.              File Attribute:  See Attribute.
  22448.  
  22449.              File Description:  See Description.
  22450.  
  22451.              Filename Completion:  A 4DOS, 4OS2, and 4DOS/NT feature which
  22452.              allows you to type part of a filename on the command line, and
  22453.              have the command processor fill in the rest for you.
  22454.  
  22455.              Free Memory:  Usually, the amount of base memory (under DOS)
  22456.              or total memory (under OS/2 and Windows NT) which is
  22457.              unoccupied and available for applications.
  22458.  
  22459.              Hidden:  A file attribute indicating that the file should not
  22460.              be displayed with a normal DIR command, and should not be made
  22461.              available to programs unless they specifically request access
  22462.              to hidden files.
  22463.  
  22464.              History:  See Command History.
  22465.  
  22466.              History Window:  See Command History Window and Directory
  22467.              History.
  22468.  
  22469.              HPFS or High Performance File System:  A file system
  22470.              distributed with OS/2 and Windows NT which allows longer file
  22471.              names and provides better performance than the traditional FAT
  22472.              file system.
  22473.  
  22474.              Include List:  A concise method of specifying several files or
  22475.              groups of files in the same directory, for use with all 4DOS,
  22476.              4OS2, and 4DOS/NT commands which take file names as arguments.
  22477.  
  22478.              .INI File:  The 4DOS, 4OS2, or 4DOS/NT initialization file
  22479.              containing directives which set the initial configuration of
  22480.              the command processor.
  22481.  
  22482.              Insert Mode:  When editing text, a mode in which newly typed
  22483.              characters are inserted into the line at the cursor position,
  22484.              rather than overwriting existing characters on the line.  See
  22485.              also Overstrike Mode.
  22486.  
  22487.              Internal Command:  A command which is part of the command
  22488.              processor, as opposed to an external command.
  22489.  
  22490.  
  22491.  
  22492.  
  22493.         -------------------------------------------------------------------
  22494.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 387
  22495.                                                                    GLOSSARY
  22496.         -------------------------------------------------------------------
  22497.  
  22498.  
  22499.              Keyboard Buffer:  A buffer which holds keystrokes you have
  22500.              typed that have not yet been used by the currently executing
  22501.              program.
  22502.  
  22503.              Keystroke Alias:  An alias assigned to a key, so that it can
  22504.              be invoked or recalled with a single keystroke.
  22505.  
  22506.              Label:  A marker in a batch file, with the format :name,
  22507.              allowing GOTO and GOSUB commands to "jump" to that point in
  22508.              the file.  See also Volume Label.
  22509.  
  22510.              LF:  The ASCII character "line feed", not usually generated
  22511.              from the keyboard, but stored in most ASCII files at the end
  22512.              of each line, after the CR character.
  22513.  
  22514.              Master Environment:  The master copy of the environment
  22515.              maintained by the command processor.
  22516.  
  22517.              Memory Resident Mode:  A method of installing 4DOS in which
  22518.              swapping is disabled, and all of 4DOS remains permanently
  22519.              resident in memory.
  22520.  
  22521.              Modulo:  The remainder after an integer division.  For example
  22522.              11 modulo 3 is 2, because when 11 is divided by 3 the
  22523.              remainder is 2.
  22524.  
  22525.              Multiple Commands:  A 4DOS, 4OS2, and 4DOS/NT feature which
  22526.              allows multiple commands to be placed on a line, separated by
  22527.              a caret [^] in 4DOS, an ampersand [&] in 4OS2 and 4DOS/NT, or
  22528.              another, user-defined character.
  22529.  
  22530.              Multitasking:  A capability of some software (and the related
  22531.              hardware) which allows two or more programs to run apparently
  22532.              simultaneously on the same computer.  Multitasking software
  22533.              for PC compatible systems includes programs like OS/2,
  22534.              Windows, Windows NT, and DESQview.
  22535.  
  22536.              NTFS or New Technology File System:  A file system distributed
  22537.              with Windows NT with characteristics similar to HPFS.  See
  22538.              also HPFS.
  22539.  
  22540.              Non-Swapping Mode:  See Memory Resident Mode.
  22541.  
  22542.              Operating System:  A collection of software which loads when
  22543.              the computer is started, provides services to other software,
  22544.              and ensures that programs don't interfere with each other
  22545.              while they are running.
  22546.  
  22547.              Option:  See Switch.
  22548.  
  22549.  
  22550.         -------------------------------------------------------------------
  22551.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 388
  22552.                                                                    GLOSSARY
  22553.         -------------------------------------------------------------------
  22554.  
  22555.  
  22556.              OR:  A logical combination of two true or false conditions.
  22557.              If both conditions are false the result is false; if either
  22558.              condition is true the result is true.
  22559.  
  22560.              Overstrike Mode:  When editing text, a mode in which newly
  22561.              typed characters overwrite existing characters on the line,
  22562.              rather than being inserted into the line at the cursor
  22563.              position.  See also Insert Mode.
  22564.  
  22565.              Parameter:  A piece of additional information placed after a
  22566.              command or function name.  For example, in the command DIR
  22567.              XYZ, XYZ is a parameter.  Also used to refer to an alias
  22568.              parameter or batch file parameter.
  22569.  
  22570.              Parsing:  The process 4DOS, 4OS2, and 4DOS/NT perform when
  22571.              they analyze the command line, perform alias and environment
  22572.              variable expansion, and find the appropriate internal command
  22573.              or external command to execute.
  22574.  
  22575.              Passed Environment:  A copy of the master environment created
  22576.              before running an application, so that any changes made by the
  22577.              application will not affect the master environment.
  22578.  
  22579.              Path:  A specification of all the directories a file resides
  22580.              in.  For example, the path for C:\WPFILES\MYDIR\MEMO.TXT is
  22581.              C:\WPFILES\MYDIR\.  Also used to refer to the environment
  22582.              variable PATH, which contains a series of path specifications
  22583.              used when searching for external commands and batch files.
  22584.  
  22585.              Pipe:  A method for collecting the standard output of one
  22586.              program and passing it on as the standard input of the next
  22587.              program to be executed, signified by a vertical bar "|" on the
  22588.              command line. See also Redirection.
  22589.  
  22590.              Primary Shell:  The copy of the command processor which is
  22591.              loaded by the operating system when the system boots or a
  22592.              session opens.
  22593.  
  22594.              RAM Disk:  A pseudo "disk drive", created by software, which
  22595.              appears like a normal physical disk drive to programs.
  22596.              Sometimes also called a "virtual disk."
  22597.  
  22598.              Range:  See Date Range, Size Range, and Time Range.
  22599.  
  22600.              Read-Only:  A file attribute indicating that the file can be
  22601.              read, but not written or deleted by the operating system or
  22602.              the command processor unless special commands are used.
  22603.  
  22604.              Reboot:  The process of restarting the computer, usually by
  22605.              pressing the Ctrl, Alt, and Del keys simultaneously.
  22606.  
  22607.         -------------------------------------------------------------------
  22608.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 389
  22609.                                                                    GLOSSARY
  22610.         -------------------------------------------------------------------
  22611.  
  22612.  
  22613.              Redirection:  A method for collecting output from a program in
  22614.              a file, and/or of providing the input for a program from a
  22615.              file.  See also Pipe.
  22616.  
  22617.              Resident Portion:  The small portion of 4DOS stored
  22618.              permanently in memory when swapping mode is in use, as opposed
  22619.              to the larger transient portion.
  22620.  
  22621.              Root Directory:  The first directory on any disk, from which
  22622.              all other directories are "descended."  The root directory is
  22623.              referenced with a single backslash [\].
  22624.  
  22625.              Secondary Shell:  Any copy of the command processor which is
  22626.              started by another program, rather than by the operating
  22627.              system.
  22628.  
  22629.              Session:  A general term for the individual windows or tasks
  22630.              started by a multitasking system.  For example, under OS/2 you
  22631.              might run an OS/2 program in one session, and a DOS program in
  22632.              another.
  22633.  
  22634.              Shell:  See Command Processor.  Also used to refer to a
  22635.              program which gives access to DOS functions and commands
  22636.              through a menu- or mouse-driven system.
  22637.  
  22638.              Size Range:  A 4DOS, 4OS2, and 4DOS/NT feature which allows
  22639.              you to select files based on their size.
  22640.  
  22641.              Source:  In file processing commands (e.g. COPY or MOVE), the
  22642.              original files before any copying or modification has taken
  22643.              place, i.e., those specified earlier on the command line.  See
  22644.              also Destination.
  22645.  
  22646.              Stack:  An area of memory used by any program to store
  22647.              temporary data while the program is running; more generally,
  22648.              any such storage area where the last item stored is normally
  22649.              the first one removed.
  22650.  
  22651.              Standard Error, Standard Input, and Standard Output:  The
  22652.              file(s) or character device(s) where a program respectively
  22653.              displays error messages, obtains its normal input, and
  22654.              displays its normal output.  Standard error, standard input,
  22655.              and standard output always refer to the console, unless
  22656.              redirection is used.
  22657.  
  22658.              Subdirectory:  Any directory other than the root directory.
  22659.  
  22660.              Swap File:  A disk file created by 4DOS to store its transient
  22661.              portion when disk swapping is in use.
  22662.  
  22663.  
  22664.         -------------------------------------------------------------------
  22665.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 390
  22666.                                                                    GLOSSARY
  22667.         -------------------------------------------------------------------
  22668.  
  22669.  
  22670.              Swapping:  A 4DOS feature which removes the larger transient
  22671.              portion of 4DOS from base memory while an application is
  22672.              running, leaving the maximum possible amount of memory for the
  22673.              application.
  22674.  
  22675.              Switch:  A parameter for an internal command or application
  22676.              which specifies a particular behavior or setting.  For
  22677.              example, the command "DIR /P" might be referred to as "having
  22678.              the /P switch set".
  22679.  
  22680.              System:  A file attribute indicating that the file belongs to
  22681.              the operating system or command processor, and should not be
  22682.              accessed by other programs.
  22683.  
  22684.              Target:  See Destination.
  22685.  
  22686.              Time Range:  A 4DOS, 4OS2, and 4DOS/NT feature which allows
  22687.              you to select files based on the time they were last modified.
  22688.  
  22689.              Transient Portion:  The larger portion of 4DOS stored in
  22690.              memory temporarily when swapping is in use, as opposed to the
  22691.              smaller resident portion.
  22692.  
  22693.              TSR:  A DOS Terminate and Stay Resident program, i.e., a
  22694.              program which "terminates" but remains resident in memory, to
  22695.              provide features such as network support, a pop-up notepad or
  22696.              telephone dialer, a disk cache, or mouse support.
  22697.  
  22698.              UMB:  An XMS Upper Memory Block, whose address is above the
  22699.              end of base memory, but within the 1 megabyte of memory that
  22700.              DOS can address directly.
  22701.  
  22702.              Variable:  See Alias Parameter, Batch File Parameter, and
  22703.              Environment Variable.
  22704.  
  22705.              Virtual Disk:  See RAM Disk.
  22706.  
  22707.              Volume Label:  A special, hidden file placed on any disk,
  22708.              whose name constitutes a "label" for the entire disk.
  22709.  
  22710.              White Space Character:  A character used to separate arguments
  22711.              on the command line.  The white space characters recognized by
  22712.              4DOS, 4OS2, and 4DOS/NT are the space, tab, and comma.
  22713.  
  22714.              Wildcard:  A character ("*" or "?") used in a filename to
  22715.              specify the possibility that any single character ("?") or
  22716.              sequence of characters ("*") can occur at that point in the
  22717.              actual name.  See also Extended Wildcard.
  22718.  
  22719.  
  22720.  
  22721.         -------------------------------------------------------------------
  22722.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 391
  22723.                                                                    GLOSSARY
  22724.         -------------------------------------------------------------------
  22725.  
  22726.  
  22727.              XMS Memory:  A software method for accessing extended memory
  22728.              under DOS.  XMS memory is not additional memory, but is a
  22729.              software specification only.
  22730.  
  22731.              XMS Swapping:  A type of swapping where the transient portion
  22732.              of 4DOS is stored in XMS memory while an application is
  22733.              running.
  22734.  
  22735.              XOR (exclusive OR):  A logical combination of two true or
  22736.              false conditions.  If both conditions are false or both
  22737.              conditions are true the result is false; if either condition
  22738.              is true and the other is false the result is true.
  22739.  
  22740.  
  22741.  
  22742.  
  22743.  
  22744.  
  22745.  
  22746.  
  22747.  
  22748.  
  22749.  
  22750.  
  22751.  
  22752.  
  22753.  
  22754.  
  22755.  
  22756.  
  22757.  
  22758.  
  22759.  
  22760.  
  22761.  
  22762.  
  22763.  
  22764.  
  22765.  
  22766.  
  22767.  
  22768.  
  22769.  
  22770.  
  22771.  
  22772.  
  22773.  
  22774.  
  22775.  
  22776.  
  22777.  
  22778.         -------------------------------------------------------------------
  22779.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 392
  22780.                                                                       Index
  22781.         -------------------------------------------------------------------
  22782.  
  22783.  
  22784.                                             * (asterisk)
  22785.         Index                                   as file name "wildcard", 59
  22786.                                                 in alias name, 165
  22787.                                                 in alias value, 163
  22788.         Conventions:  Most fully                to temporarily disable an
  22789.         capitalized terms (e.g., ECHO,            alias, 48, 88, 163
  22790.         SELECT) are command names
  22791.         unless otherwise noted.             ., see Current directory
  22792.                                             .., see Parent directory
  22793.  
  22794.         Special Characters                  /, in command switches, 156
  22795.  
  22796.                                             ; (semicolon)
  22797.         ## advanced topic mark, 3, 34,          in HPFS and NTFS file
  22798.          158                                      names, 17, 62
  22799.         ! warning mark, 3, 158                  in include lists, 67
  22800.  
  22801.         $ (dollar sign), as parameter       ? as file name "wildcard", 59
  22802.          character, 140, 325                ? command, 159
  22803.             in batch files, 82
  22804.                                             @ sign, see also Variable
  22805.         % sign                               functions
  22806.             and alias parameters, 168           for key codes, 32
  22807.             and batch file parameters,              in a keystroke alias,
  22808.               81                                      166
  22809.             and environment variables,          in file names, 16
  22810.               96, 97                            in INKEY results, 259
  22811.             in file names, 16                   to define a keystroke
  22812.             use with variable                     alias, 165
  22813.               functions, 108                    to override batch file
  22814.         %# and %n&                                echo, 81, 223, 305
  22815.             changing parameter                  to override command history
  22816.               character, 140, 325                 save, 37
  22817.             in aliases, 168                     to read a file in FOR, 238
  22818.             in batch files, 82, 330
  22819.         %0 to %127                          ^ (caret)
  22820.             in aliases, 168                     as command separator, 137,
  22821.             in batch files, 81, 330               323
  22822.                                                 as escape character, 138,
  22823.         & (ampersand)                             324
  22824.             as command separator, 137,
  22825.               323                           || (or) in conditional
  22826.             as parameter character,          commands, 71
  22827.               140, 325
  22828.                 in batch files, 82          4
  22829.         && (and) in conditional
  22830.           commands, 71                      4DOS
  22831.                                                 and DESQview, 149
  22832.                                                 and disk caching software,
  22833.                                                   149
  22834.  
  22835.         -------------------------------------------------------------------
  22836.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 393
  22837.                                                                       Index
  22838.         -------------------------------------------------------------------
  22839.  
  22840.  
  22841.         4DOS (continued)                    Aliases (continued)
  22842.             and DR DOS, 255, 269, 352           editing, 227
  22843.             and HPFS files, 17                  examples, 77, 87, 89
  22844.             and MS-DOS 5.0 and above,           expansion, 50, 122
  22845.               269                                   and batch file
  22846.             and Novell DOS, see 4DOS                  debugging, 90
  22847.               and DR DOS                            disabling, 327
  22848.             and SMARTDRV, see Microsoft             nested, 122
  22849.               SMARTDRV, 392                     global, 134, 169
  22850.             and Windows, see Microsoft              storing in upper
  22851.               Windows                                 memory, 135
  22852.             configuration, 126                  in batch files, 87
  22853.             memory usage, 136                   inheritance, in secondary
  22854.             resident portion, loading             shells, 149
  22855.               in upper memory, 136              internal variables in, 169
  22856.             REXX support in, 95                 keystroke, 79, 165
  22857.             stack size, 150                         and key assignments,
  22858.         4DOS/NT                                       143
  22859.             configuration, 126                      automatic execution of,
  22860.             EXTPROC support in, 96                    74, 79, 166
  22861.             REXX support in, 95                 local, 134, 169
  22862.         4EXIT, 86                               memory space for, 103, 131,
  22863.             location of, 131                      280
  22864.         4OS2                                    multiple commands in, 162
  22865.             configuration, 126                  nested, 78, 122, 163
  22866.             EXTPROC support in, 96              order of execution, 122
  22867.             REXX support in, 95                 parameters, 168, 169
  22868.         4START, 85, 108                             expansion, 122
  22869.             location of, 131                    reading from a file, 171
  22870.                                                 removing, 350
  22871.         A                                       saving in a file, 167
  22872.                                                 saving temporarily, 329
  22873.         Abort, Retry, Fail message, see         sharing between 4DOS, 4OS2,
  22874.           Critical errors                         and 4DOS/NT, 74
  22875.         ACTIVATE command, 160                   storing in upper memory,
  22876.         Advanced Power Management                 135
  22877.           status, 103                           suspending execution of,
  22878.         Advanced topic mark, see v                293
  22879.         ALIAS command, 20, 161                  variable functions in, 120,
  22880.         Aliases, 77, 161                          169
  22881.             and executable extensions,      And (&&) in conditional
  22882.               69                              commands, 71
  22883.             and QUIT, 301                   .AND., in IF and IFF, 251, 255,
  22884.             asterisk in name, 165             257
  22885.             asterisk in value, 163          ANSI driver, 25
  22886.             back-quotes in, 125, 162,           and CLS, 185, 323
  22887.               167, 172                          and COLOR, 186, 323
  22888.             defining default command            and PROMPT, 298
  22889.               options with, 163, 168            and screen colors, 143
  22890.             disabling, 48, 88, 163, 327         and scrolling, 326
  22891.  
  22892.         -------------------------------------------------------------------
  22893.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 394
  22894.                                                                       Index
  22895.         -------------------------------------------------------------------
  22896.  
  22897.  
  22898.         ANSI driver (continued)             Batch files (continued)
  22899.             and TEXT, 342                       detecting 4DOS, 4OS2, or
  22900.             detecting, 103                        4DOS/NT from, 86
  22901.             escape sequences, 74, 298,          displaying messages in,
  22902.               342                                 223, 225, 310, 312, 342,
  22903.             use by 4DOS, 137                      355
  22904.         APM, see Advanced Power                 echoing of commands, 81,
  22905.           Management                              137, 223, 326
  22906.         Appending files, 187                    environment variables in,
  22907.         Archive attribute, see File               82
  22908.           attributes                            handling Ctrl-Break, 288
  22909.         Argument quoting, 123                   handling errors, 288
  22910.         Arguments, see Parameters               handling strings in, 91,
  22911.         Arithmetic, 112                           327
  22912.         ASCII, 22                               internal variables in, 82,
  22913.         Asterisk, see *                           108
  22914.         At sign, see @ sign                     interrupting, 85
  22915.         ATTRIB, 173                             keyboard input in, 259, 262
  22916.         Attributes, see File attributes         labels in, 245, 246
  22917.         AUTOEXEC.BAT, 86                        line numbers in, 89, 104
  22918.             location of, 131                    modes, 80, 276
  22919.             parameters for, 132                 names of, 82, 104
  22920.             speeding up, 339                    nesting, 104, 179
  22921.             starting KSTACK.COM, 57,            parameters, 81, 330
  22922.               266                                   expansion, 122
  22923.         Automatic batch files, 85               samples, 84
  22924.         Automatic directory changes, 47         saving environment in, 329
  22925.                                                 screen display, 219, 221,
  22926.         B                                         222
  22927.                                                 sharing between 4DOS, 4OS2,
  22928.         Backspace character, 74                   and 4DOS/NT, 74
  22929.         Base memory, see Memory                 string processing in, 91,
  22930.         Base name, see File names                 327
  22931.         .BAT files, 20, 80, 276                 subroutines, 245, 309
  22932.         Batch files, 80                         suspending execution of,
  22933.             aliases in, 87, 88                    293
  22934.             and executable extensions,          temporary variables in, 83
  22935.               69                                terminating, 180, 301
  22936.             and redirection, 53                 timing events in, 344
  22937.             automatic, 85                       variable functions in, 82,
  22938.             based on command history,             120
  22939.               249                           BATCOMP.EXE, 93
  22940.             branching in, 246               BEEP, 83, 137, 176
  22941.             calling, 179                    Beeps
  22942.             capturing output of, 90             frequency of, 137
  22943.             chaining, 179                       length of, 137
  22944.             commands for, 83, 154           BIOS output
  22945.             comments in, 305                    and color-coded directory
  22946.             compression, 93                       displays, 31
  22947.             debugging, 89                       and DRAWBOX, 220
  22948.  
  22949.         -------------------------------------------------------------------
  22950.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 395
  22951.                                                                       Index
  22952.         -------------------------------------------------------------------
  22953.  
  22954.  
  22955.         BIOS output (continued)             Colors (continued)
  22956.             and DRAWHLINE, 221                  in directories, 30
  22957.             and DRAWVLINE, 222                  in history window, 139
  22958.             and LIST, 274                       in LIST, 142, 274
  22959.             and SCRPUT, 312                     in PROMPT, 298
  22960.             and SELECT, 316                     in SELECT, 142, 315
  22961.             and VSCRPUT, 355                    names of, 26
  22962.         BIOS output, in 4DOS, 150               numbers for, 26
  22963.         Border colors, see Colors               of border, 27
  22964.         Boxes, drawing, on screen, 219          of boxes, 219
  22965.         BREAK, 177                              of lines, 221, 222
  22966.         .BTM files, 20, 80, 276                 of text, 312, 342, 355
  22967.                                                 of typed input, 36, 142
  22968.         C                                       setting defaults, 141, 185,
  22969.                                                   186
  22970.         CALL, 83, 179                           setting, in 4START, 108
  22971.         CANCEL, 83, 179, 180, 301               standard, 142
  22972.         Caps Lock key, 264                      testing, 104, 105
  22973.         Carriage return character, 74       Command grouping, 71. see also
  22974.             in keystroke aliases, 166         EXCEPT, FOR, GLOBAL, and IF
  22975.         Case (upper / lower), 18, 107,          and redirection, 53, 72
  22976.           141, 326                          Command history, see History
  22977.         CD, 181                               list
  22978.         CDD, 183                            Command line, 34
  22979.         CDFS file system, 116                   arguments, see Parameters
  22980.         CDPATH environment variable,            automatic directory
  22981.           43, 47, 98, 182, 183, 300               changes, 47
  22982.         Changing directories, 43, 47,           echoing of, 223, 224
  22983.           181, 183, 294, 299                    editing, 35, 144, 145
  22984.         CHCP, 184                               editing mode, 35, 138, 325
  22985.         CHDIR, 181                              expanded, viewing, 224
  22986.         CLS, 83, 185                            filename completion, 41
  22987.         .CMD files, 20, 80, 276                 help, 48
  22988.         CMDLINE environment variable,           history, 36. see also
  22989.           99                                      History list
  22990.         Code pages, see Country code            history window, 40
  22991.         Cold reboot, 303                        input method, 140, 325
  22992.         COLOR, 83, 186                          multiple commands, 47
  22993.         Color-coded directory displays,         processing of, 19, 121
  22994.           30, 142, 206, 315                     prompt, 295
  22995.             and redirection, 206            Command parsing, 121
  22996.         COLORDIR environment variable,      Command processor, 10
  22997.           30, 99, 206, 315                  Command Reference Guide, 153
  22998.         Colors                              Command separator, 47, 75, 102,
  22999.             and ANSI driver, 25, 143,         137, 323
  23000.               323                               disabling, 327
  23001.             blinking text, 28                   in IFF, 257
  23002.             bright background, 28, 141,     Command tail, 19, 121
  23003.               323                           COMMAND.COM message server, 149
  23004.             errors in, 27
  23005.  
  23006.         -------------------------------------------------------------------
  23007.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 396
  23008.                                                                       Index
  23009.         -------------------------------------------------------------------
  23010.  
  23011.  
  23012.         Commands                            Ctrl-Break
  23013.             conditional execution of,           at file processing prompt,
  23014.               257                                 51
  23015.             external, 19, 153, 290              at page prompt, 50
  23016.                 and /? help, 49                 checking, 177, 288
  23017.                 exit codes for, 102             during DELAY, 200
  23018.             format of, 155                      during INKEY, 259, 262, 293
  23019.             help for, 48, 248                   during SELECT, 314
  23020.             internal, 19, 153                   in batch files, 85, 288
  23021.                 disabling, 159, 324             in external programs, 102
  23022.             length of, 35, 48, 50           Ctrl-C, see Ctrl-Break
  23023.             list of, 159                    Ctrl-X, see Escape character
  23024.             new, 155                        Ctrl-Z end of file mark, and
  23025.             order of execution, 122           COPY, 191
  23026.             types of, 155                   CTTY, 54, 194
  23027.             unknown, handling, 171          Current drive and directory, 16
  23028.         Comments                                changing, see Changing
  23029.             in .INI file, 127                     directories
  23030.             in alias files, 172                 retrieving, 104
  23031.             in batch files, 305                 saving temporarily, 299,
  23032.             in environment variable               329
  23033.               files, 321                    Cursor
  23034.         Compatibility between 4DOS,             positioning, 310, 312, 355
  23035.           4OS2, and 4DOS/NT, 74                 shape, 138, 326
  23036.         Compound character, see Command
  23037.           separator                         D
  23038.         Compressed drives, 209, 316
  23039.         COMSPEC environment variable,       Daily execution of batch file,
  23040.           99, 127, 351                        120
  23041.         Conditional commands, 71            DATE, 195
  23042.             disabling, 327                      time format, 137
  23043.         CONFIG.SYS, 12                      Date ranges, 62
  23044.         Configuration, of 4DOS, 4OS2,       Dates, formatting, 117
  23045.           and 4DOS/NT, 98, 126              Day of week, 105
  23046.         CONsole device, 194. see also       Default directory, see Current
  23047.           Standard input, Standard            drive and directory
  23048.           output, and Standard error        Default drive, see Current
  23049.         Coprocessor, see Numeric              drive and directory
  23050.           coprocessor                       DEL, 196
  23051.         COPY, 187                           DELAY, 200
  23052.             and ctrl-Z end of file          DELDIR environment variable,
  23053.               mark, 191                       197, 285
  23054.             and extended attributes,        Delete tracking, 197
  23055.               190                           Deleting files, 196
  23056.         Country code, 23, 104, 184, 195     DESCRIBE, 144, 201
  23057.         Critical errors, 51, 102            DESCRIPT.ION, see File
  23058.             automatic Fail response,          descriptions
  23059.               148                           Descriptions, see File
  23060.             detecting, 288                    descriptions
  23061.  
  23062.  
  23063.         -------------------------------------------------------------------
  23064.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 397
  23065.                                                                       Index
  23066.         -------------------------------------------------------------------
  23067.  
  23068.  
  23069.         DESQview                            DOS
  23070.             and 4DOS, 149                       commands, help for, 48, 153
  23071.             and secondary shells, 129           compatibility box, see OS/2
  23072.             detecting, 105, 108                   DOS sessions
  23073.         DETACH, 203                             default command processor,
  23074.         Detecting 4DOS, 4OS2, or                  11
  23075.           4DOS/NT from a batch file, 86         memory, see Memory
  23076.         DIR, 204                            DOS/V (Japan), 150
  23077.             and include lists, 68           DPATH, 218
  23078.             color-coded displays, 30,       DPMI (DOS Protected Mode
  23079.               142, 206                        Interface) status, 105
  23080.                 and CTTY, 194               DRAWBOX, 83, 219
  23081.                 and redirection, 206,       DRAWHLINE, 83, 221
  23082.                   210                       DRAWVLINE, 83, 222
  23083.             directory size limits, 208      Drive, see Disk drives
  23084.             displaying file
  23085.               descriptions, and             E
  23086.               redirection, 207, 212
  23087.             time format, 137                ECHO, 223
  23088.         DIRCMD environment variable, 99         ANSI sequences in, 74
  23089.         Directories, see Subdirectories         at command line, 224
  23090.         Directory history, 45                   in batch files, 81, 83, 89,
  23091.             and secondary shells, 46              305
  23092.             local and global, 45                    default state, 137, 326
  23093.             size of, 132                            inheritance, 179
  23094.             storing in upper memory,        ECHOS, 83, 225
  23095.               135                           Editing aliases and environment
  23096.             window, 45                        variables, 227
  23097.         Directory stack, 299                ELSE and ELSEIFF, in IFF, 257
  23098.             clearing, 294                   EMS, see Memory
  23099.             displaying, 214                 ENDDO, in DO, 215
  23100.         Directory tree, 15                  ENDIFF, in IFF, 257
  23101.         DIREXIST test, in IF and IFF,       ENDLOCAL, 83, 88, 226, 329, 351
  23102.           255                               ENDTEXT, 84, 342
  23103.         DIRS, 214, 294, 299                 Environment, 21, 96, 319
  23104.         Disk drives, 14                         master, 98, 118, 228, 320,
  23105.             compressed, 209, 316                  351
  23106.             drive letter, 14                    saving temporarily, 329
  23107.             space on, 112, 242                  size of, 97, 132, 320
  23108.             swapping to, 134, 339                   displaying, 280
  23109.             testing status of, 118                  testing, 105
  23110.             volume label, 117, 354              storing in upper memory,
  23111.             write verification on, 353            136
  23112.         Display colors, see Colors          Environment variables, 22, 96,
  23113.         DO, 83, 215                           319
  23114.             and GOTO, 216                       and INKEY, 259
  23115.                                                 and INPUT, 262
  23116.                                                 characters in name, 97
  23117.                                                 creating, 319
  23118.                                                 displaying, 319
  23119.  
  23120.         -------------------------------------------------------------------
  23121.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 398
  23122.                                                                       Index
  23123.         -------------------------------------------------------------------
  23124.  
  23125.  
  23126.         Environment variables               Extended attributes
  23127.           (continued)                           and COPY, 190
  23128.             editing, 227                        and MOVE, 283
  23129.             expansion, 50, 122              Extended key codes, see Keys
  23130.                 and batch file              Extended memory, see Memory
  23131.                   debugging, 90             Extended parent directory
  23132.                 disabling, 327                names, 59
  23133.                 nested, 97                  Extension, see File names
  23134.             for current directory, in       External commands, see Commands
  23135.               Windows NT, 100               EXTPROC support, in 4OS2 and
  23136.             nesting, 97                       4DOS/NT, 96
  23137.             reading from a file, 321
  23138.             referencing, 96                 F
  23139.             removing, 351
  23140.             spaces in, 320                  FAT file system, 14
  23141.         ERASE, 196                              detecting, 116
  23142.         Error level, see Exit codes             file names, 16
  23143.         Error messages, 359                     path length, 16
  23144.         ERRORLEVEL test, in IF and IFF,     File attributes, 18, 173
  23145.           254                                   and COPY, 190, 192
  23146.         Errors, handling, in batch              and DEL, 198
  23147.           files, 288                            and DIR, 204, 209, 212
  23148.         Escape character, 73, 75, 102,          and EXCEPT, 229
  23149.           138, 324                              and FOR, 240
  23150.         ESET, 98, 144, 227, 320                 and GLOBAL, 243
  23151.             and PATH, 290                       and MOVE, 285
  23152.         EXCEPT, 72, 229                         and REN, 307
  23153.             and DEL /Z, 198                     and SELECT, 316
  23154.         Executable extensions, 20, 68,          of subdirectories, 174
  23155.           123, 290                              setting, 173
  23156.             and filename completion, 42         subdirectory, 174
  23157.             and Personal REXX, 95               testing, 111
  23158.             wildcards in, 70                    viewing, 173
  23159.         EXIST test, in IF and IFF, 255          volume label, 174
  23160.         EXIT, 231                           File descriptions, 201
  23161.         Exit codes, 123                         controlling processing of,
  23162.             and CALL, 179                         138, 324
  23163.             and CANCEL, 180                     displaying, and
  23164.             and conditional commands,             redirection, 207, 212
  23165.               71                                file name for, 105, 148,
  23166.             and DEL, 197                          201
  23167.             and EXIT, 231                       length of, 138, 201, 206,
  23168.             and GLOBAL, 243                       315
  23169.             and IF tests, 254                   retrieving, 112
  23170.             and PROMPT, 295                     selecting files by, 205,
  23171.             and QUIT, 301                         210, 316, 317
  23172.             retrieving, 102                     sorting by, 211, 235, 318
  23173.         Expanded memory, see Memory
  23174.         Extended ASCII, see ASCII
  23175.  
  23176.  
  23177.         -------------------------------------------------------------------
  23178.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 399
  23179.                                                                       Index
  23180.         -------------------------------------------------------------------
  23181.  
  23182.  
  23183.         File names, 13, 16, 58              FOR, 72, 84, 237
  23184.             alternate, under Windows            and GOSUB, 239
  23185.               NT, 111, 213                  Form feed character, 74
  23186.             FAT-compatible, 17              FREE, 242
  23187.             HPFS and NTFS, 17               Free memory, see Memory
  23188.                 extensions, 18
  23189.                 quoting, 17                 G
  23190.                 semicolons in, 17, 62
  23191.             length of, 16, 58               General Concepts, 10
  23192.             parts of, 13                    GLOBAL, 72, 243
  23193.                 separating, 113, 114,       Glossary, 381
  23194.                   116, 118                  GOSUB, 83, 245, 309
  23195.             shorthand for, 58                   and FOR, 239
  23196.             unique, 119                     GOTO, 83, 246
  23197.         File processing prompts, 50             and DO, 216
  23198.         File system, see FAT file               and IFF, 258
  23199.           system, HPFS file system, and
  23200.           NTFS file system                  H
  23201.         Filename completion, 41
  23202.             window, 42                      HELP, 48, 248
  23203.         Files, 13                               and external commands, 153
  23204.             adding line numbers to, 348         books to load, in 4OS2, 132
  23205.             copying, 187                        location of files, in 4DOS,
  23206.             date stamp, 19, 113, 195,             133
  23207.               204                               options, in 4DOS, 132
  23208.             deleting, 196                   Hidden attribute, see File
  23209.             displaying, 272, 348              attributes
  23210.             finding, 115                    HISTORY, 249
  23211.             forcing deletion of, 197,       History list, 36, 249
  23212.               285                               and secondary shells, 40,
  23213.             moving, 282, 306                      170
  23214.             processing data from, 114,          controlling, 139, 250
  23215.               117                               global, 39, 134
  23216.             reading, in FOR, 238                    storing in upper
  23217.             renaming, 306                             memory, 136
  23218.             searching for, 118                  inheritance, in secondary
  23219.             selecting, 58, 313                    shells, 149
  23220.                 with date, time, and            local, 39, 134
  23221.                   size ranges, 62               local and global, 134
  23222.                 with extended parent            memory space for, 280
  23223.                   directory names, 59           reading from a file, 250
  23224.                 with include lists, 67          size of, 133
  23225.                 with multiple               History windows
  23226.                   filenames, 66                 colors of, 139
  23227.                 with wildcards, 59              command line, 40
  23228.             size of, 115, 204                   directory, 45
  23229.             time stamp, 19, 115, 204,           position of, 139, 140
  23230.               343                               size of, 139, 140
  23231.             true path of, 119, 347          HMA, see Memory
  23232.  
  23233.  
  23234.         -------------------------------------------------------------------
  23235.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 400
  23236.                                                                       Index
  23237.         -------------------------------------------------------------------
  23238.  
  23239.  
  23240.         HPFS file system, 14                Input and output, commands for,
  23241.             and 4DOS, 17                      154
  23242.             and DIR, 208, 211, 213          Installable file systems
  23243.             and file descriptions, 202        (OS/2), 15, 116
  23244.             and SELECT, 318                 INT 2E support (4DOS), 149
  23245.             detecting, 116                  Internal commands, see Commands
  23246.             file dates and times, 66        Internal variables, 100. see
  23247.             file names, 17, 58, 326           also Quick Reference on page
  23248.             path length, 16                   407
  23249.             semicolons in file names,           in aliases, 169
  23250.               17, 62                            in batch files, 82, 108
  23251.             time stamps in, 212             International character sets,
  23252.                                               23, 184, 220, 221, 222, 371
  23253.         I                                   ISALIAS test, in IF and IFF,
  23254.                                               255
  23255.         IF, 72, 84, 251                     ISDIR test, in IF and IFF, 255
  23256.             conditions, 252                 ISINTERNAL test, in IF and IFF,
  23257.         IFF, 84, 257                          255
  23258.             and GOSUB, 245                  ISWINDOW test, in IF and IFF,
  23259.             and GOTO, 258                     255
  23260.             conditions, 252                 ITERATE, in DO, 215
  23261.         Include lists, 67
  23262.         .INI file, 126                      J
  23263.             advanced directives, 148
  23264.             and installation, 126           JOIN (DOS command), 347
  23265.             and SETDOS, 129, 136, 322
  23266.             changing, for secondary         K
  23267.               shells, 148
  23268.             color directives, 141           KEYBD, 264
  23269.             comments in, 127                Keyboard
  23270.             configuration directives,           Caps Lock, Num Lock, and
  23271.               136                                 Scroll Lock, 264
  23272.             directive types, 130                checking buffer, 105, 260,
  23273.             directives, 127. see also             263
  23274.               Quick Reference on page           clearing buffer, 260, 263,
  23275.               407                                 266
  23276.             errors in, 128, 133, 134        Keys, 265
  23277.             global section, 128                 codes, 22, 375
  23278.             initialization directives,              ASCII, 22, 371
  23279.               131                                   extended ASCII, 23
  23280.             key mapping directives, 143         F11 and F12, using, 32
  23281.             location of, and                    mapping, 143
  23282.               multitaskers, 129                     clearing default key
  23283.             primary section, 128                      map, 148
  23284.             prompts during execution,               for all input, 144
  23285.               133                                   for command line
  23286.             secondary section, 128                    editing, 145
  23287.         INKEY, 84, 89, 259                          for history windows,
  23288.         INPUT, 84, 144, 262                           146
  23289.                                                     for LIST, 147
  23290.  
  23291.         -------------------------------------------------------------------
  23292.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 401
  23293.                                                                       Index
  23294.         -------------------------------------------------------------------
  23295.  
  23296.  
  23297.         Keys (continued)                    Memory (continued)
  23298.             names, 31, 165                      upper memory blocks (UMBs)
  23299.         KEYSTACK, 57, 84, 90, 266                   and LOADHIGH, 269
  23300.         Keystroke aliases, see Aliases              loading 4DOS in, 136
  23301.         KSTACK.COM, 57, 266                         storing aliases in, 135
  23302.                                                     storing directory
  23303.         L                                             history in, 135
  23304.                                                     storing environment in,
  23305.         Labels, in batch files, 245,                  136
  23306.           246                                       storing history in, 136
  23307.         LEAVE, in DO, 215                   Memory resident programs, see
  23308.         LH, 269                               TSRs
  23309.         LIM EMS, see Memory                 Messages, displaying, 223, 225
  23310.         Line feed character, 74             Microsoft SMARTDRV, and 4DOS,
  23311.         Lines, drawing, on screen, 221,       150
  23312.           222                               Microsoft Windows
  23313.         LIST, 272                               and screen colors, 29
  23314.             default colors, 142                 and secondary shells, 129
  23315.             keys used with, 144, 147            detecting, 107
  23316.             print device for, 141           MKDIR, 279
  23317.             screen size, 141, 326           Monitor, detecting type of, 106
  23318.         LOADBTM, 80, 84, 276                Monochrome monitor, and colors,
  23319.         LOADHIGH, 269                         27
  23320.         LOG, 90, 277                        MOVE, 282
  23321.         Log files, time format, 137             and extended attributes,
  23322.         Lower case, 141, 326                      283
  23323.                                                 and SELECT, 283
  23324.         M                                   MSGBOX, 287
  23325.                                             Multiple commands, 47
  23326.         Master environment, see                 disabling, 327
  23327.           Environment                           in aliases, 162
  23328.         MD, 279                                 separator character, see
  23329.         Memory, 280                               Command separator
  23330.             base                            Multiple filenames, 66
  23331.                 amount of, 112
  23332.                 DOS in, 352                 N
  23333.             expanded (EMS)
  23334.                 amount of, 112, 280         Netware, see Novell Netware
  23335.                 swapping to, 134, 339       Networks
  23336.             extended (XMS)                      disk swapping on, 151
  23337.                 amount of, 120, 280             drive names on, 14
  23338.                 swapping to, 134, 339       NOT, in IF and IFF, 251, 255,
  23339.             extended, amount of, 113,         257
  23340.               280                           Novell Netware, and 4DOS, 150,
  23341.             free, 280                         151
  23342.             high memory area (HMA)          NTFS file system, 14
  23343.                 DOS in, 352                     and DIR, 208, 211, 213
  23344.                 status of, 280                  and file descriptions, 202
  23345.                                                 and SELECT, 318
  23346.                                                 detecting, 116
  23347.  
  23348.         -------------------------------------------------------------------
  23349.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 402
  23350.                                                                       Index
  23351.         -------------------------------------------------------------------
  23352.  
  23353.  
  23354.         NTFS file system (continued)        PATH environment variable, 99
  23355.             file dates and times, 66            "." in, 291
  23356.             file names, 17, 58, 326             and @SEARCH variable
  23357.             path length, 16                       function, 118
  23358.             semicolons in file names,           changing, 227, 290
  23359.               17, 62                            format of, 290
  23360.             short file names, 111, 213          invalid directory in, 292
  23361.             time stamps on, 212                 length of, 291
  23362.         Num Lock key, 264                       viewing, 290
  23363.         Numbers, comparing, 252             Path, of a file, 13, 16
  23364.         Numeric coprocessor, 106                and aliases, 78
  23365.         Numeric strings                         extracting from full file
  23366.             formatting, 111                       name, 118
  23367.             testing for, 118                    finding full path name, 116
  23368.                                                 finding true path, 119, 347
  23369.         O                                       if omitted, 16
  23370.                                                 in executable extensions,
  23371.         ON, 288                                   69
  23372.         Operating system, 10                    in include lists, 67
  23373.             detecting, 105                      length of, 16
  23374.         Options, in commands, 156           PAUSE, 84, 89, 293
  23375.         Or (||) in conditional              Percent sign, see % sign
  23376.           commands, 71                      Personal REXX, 95
  23377.         .OR., in IF and IFF, 251, 255,      Pipes, 55, 340
  23378.           257                                   disabling, 327
  23379.         OS/2                                    in 4OS2 and 4DOS/NT, 56
  23380.             and screen colors, 29               nested, 56
  23381.             commands, help for, 153             testing for, 106
  23382.             default command processor,      POPD, 214, 294, 299
  23383.               11                            Previous working directory,
  23384.             detecting, 105                    saving and restoring, 44,
  23385.             DOS sessions, 105, 151            182, 183
  23386.                 extended attributes         Primary shell, see Shell
  23387.                   and, 190, 283             [Primary], see .INI file
  23388.                 in OS/2 version 2.0,        Printer
  23389.                   13, 107                       checking status of, 117
  23390.                                                 sending control codes to,
  23391.         P                                         74
  23392.                                                 sending files to, 187
  23393.         Paged output, 50, 141                   use in LIST, 274
  23394.         Parameter character, 75             PROMPT command, 295
  23395.         Parameters                              ANSI sequences in, 74, 298
  23396.             expansion, 122                      changing for secondary
  23397.             in aliases, 168, 169                  shell, 108
  23398.             in batch files, 81, 330         PROMPT environment variable, 99
  23399.         Parent directory, 16, 59, 181,      Prompt Solution, The, 6
  23400.           183, 279                          PUSHD, 214, 294, 299
  23401.         PATH command, 290
  23402.  
  23403.  
  23404.  
  23405.         -------------------------------------------------------------------
  23406.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 403
  23407.                                                                       Index
  23408.         -------------------------------------------------------------------
  23409.  
  23410.  
  23411.         Q                                   S
  23412.  
  23413.         Quick reference                     Scan codes, see Keys
  23414.             .INI file directives, 410       Screen, 84, 310. see also
  23415.             internal variables, 407           Colors
  23416.             variable functions, 409             clearing, 185
  23417.         QUIT, 84, 179, 180, 301                 reading text from, 118
  23418.         Quoting                                 size, 24, 141, 326
  23419.             of arguments, 123                       detecting, 104, 106
  23420.             of file names, 17               Scroll Lock key, 264
  23421.                                             SCRPUT, 84, 312
  23422.         R                                   Search path, see PATH
  23423.                                               environment variable
  23424.         RAM, see Memory                     Secondary shell, see Shell
  23425.         RAM disk, 14                        [Secondary], see .INI file
  23426.             swapping to, 134                SELECT, 313
  23427.         Ranges (date, time, and size),          and command grouping, 72
  23428.           62                                    and include lists, 68
  23429.         RD, 302                                 and MOVE, 283
  23430.         Read-only attribute, see File           color-coded displays, 30,
  23431.           attributes                              142, 315, 317
  23432.         REBOOT, 303                             default colors, 142, 315
  23433.         Redirection, 52                         keys used with, 144
  23434.             alternative methods, 340,           screen size, 141, 326
  23435.               358                               time format, 137
  23436.             and batch files, 53             Semicolon, see ;
  23437.             and color-coded directory       SET, 98, 319
  23438.               displays, 206                 SETDOS, 322
  23439.             and command grouping, 53,           /A(NSI), 137, 185, 186, 323
  23440.               72                                /B(rightBG), 28, 142, 323
  23441.             and NoClobber, 54, 325              /C(ompound character), 75,
  23442.             capturing batch file                  137, 323
  23443.               output, 90                        /D(escriptions), 138, 324
  23444.             disabling, 327                      /E(scape character), 75,
  23445.             nested, 54                            138, 324
  23446.             preventing file overwrites,         /I(nternal), 159, 255, 324
  23447.               140                               /L(ine), 140, 325
  23448.             with numeric file handles,          /M(ode), 138, 325
  23449.               54                                /N(o clobber), 140, 325
  23450.         Registration, 6                         /P(arameter character), 75,
  23451.         REM, 84, 305                              82, 141, 325
  23452.         REN, 282, 306                           /R(ows), 141, 326
  23453.         RENAME, 282, 306                        /S(hape), 138, 326
  23454.         RETURN, 83, 245, 309                    /U(pper), 107, 141, 210,
  23455.         REXX support, 95                          234, 326
  23456.         RMDIR, 302                              /V(erbose), 81, 137, 326
  23457.         Root directory, 15                      /X (expansion), 48, 93, 97,
  23458.                                                   111, 123, 125, 327
  23459.                                                 /Y (single step), 89, 328
  23460.                                                 and .INI file, 129, 322
  23461.  
  23462.         -------------------------------------------------------------------
  23463.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 404
  23464.                                                                       Index
  23465.         -------------------------------------------------------------------
  23466.  
  23467.  
  23468.         SETLOCAL, 83, 84, 88, 329, 351      Swapping, 134
  23469.         Shell, 1                                enabling and disabling, 339
  23470.             level, 106, 296                     file names used by, 134,
  23471.             primary, 12                           151
  23472.             secondary, 12                       types of, 134
  23473.                 inheritance, 129, 149,      SWAPPING command, 339
  23474.                   322                       Switches, in commands, 156
  23475.         SHIFT, 82, 84, 330                  System
  23476.         SHRALIAS program, 40, 46, 170           attribute, see File
  23477.         Size ranges, 62                           attributes
  23478.         SMARTDRV, see Microsoft                 rebooting, 303
  23479.           SMARTDRV, 392
  23480.         Sound, see BEEP                     T
  23481.         Stack size, in 4DOS, 150
  23482.         Standard error, 52                  Tab character, 74
  23483.         Standard input, 52, 275, 340,       Technical support, 7
  23484.           358                               TEE, 56, 340
  23485.         Standard output, 52, 340, 358       TEMP environment variable, 100
  23486.         START, 84, 331                      TEMP4DOS environment variable,
  23487.         Startup command line, viewing,        100
  23488.           in 4START, 85                     TEXT, 84, 342
  23489.         Status tests, in IF and IFF,        THEN, in IFF, 257
  23490.           254                               TIME, 343
  23491.         Stopwatch, see TIMER                Time ranges, 62
  23492.         Strings                             Time, format of, 137
  23493.             comparing, 252                  TIMER, 84, 119, 344
  23494.             formatting, 111, 116                time format, 137
  23495.             testing for numeric digits,     Times, formatting, 117
  23496.               118                           TITLE, 346
  23497.         Subdirectories, 15                  TRUENAME, 347
  23498.             attributes of, 174              TSRs
  23499.             changing, see Changing              and .BTM files, 276
  23500.               directories                       and SETLOCAL, 329
  23501.             copying, 192                        and swapping state, 339
  23502.             creating, 279                   TYPE, 348
  23503.             deleting files from, 198
  23504.             descriptions for, 201           U
  23505.             executing commands in, 243
  23506.             hidden, 243                     UMBs, see Memory
  23507.             moving, 282, 285                UNALIAS, 88, 350
  23508.             name, maximum length of, 16     Unknown commands, handling, 171
  23509.             removing, 198, 285, 302         UNKNOWN_CMD alias, 21, 171
  23510.             renaming, 306                       and IFF, 247
  23511.             testing for, 255                UNSET, 83, 98, 351
  23512.         Subdirectory attribute, see         UNTIL, in DO, 215
  23513.           File attributes                   Upgrades, 6
  23514.         SUBST (DOS command), 347            Upper case, 141, 326
  23515.         Support, 7                          Upper memory, see Memory
  23516.  
  23517.  
  23518.  
  23519.         -------------------------------------------------------------------
  23520.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 405
  23521.                                                                       Index
  23522.         -------------------------------------------------------------------
  23523.  
  23524.  
  23525.         V                                   Windows NT
  23526.                                                 and screen colors, 29
  23527.         Variable expansion, see                 default command processor,
  23528.           Environment variables,                  11
  23529.           expansion                             detecting, 105
  23530.         Variable functions, 108. see
  23531.           also Quick Reference on page      X
  23532.           407
  23533.             in aliases, 120, 169            XMS, see Memory
  23534.             in batch files, 82, 120         .XOR., in IF and IFF, 251, 255,
  23535.         VER, 352                              257
  23536.         VERIFY, 193, 286, 353
  23537.         Version numbers, 103, 105, 352      Y
  23538.         Vertical text display, 355
  23539.         Video hardware, 24. see also        Y, 56, 358
  23540.           Screen
  23541.             detecting, 106, 107             Z
  23542.         Virtual disk, see RAM disk
  23543.         VOL, 354                            Zero length files, creating,
  23544.         Volume, see Disk drives               54, 305
  23545.         Volume label, see Disk drives
  23546.         Volume label attribute, see
  23547.           File attributes
  23548.         VSCRPUT, 84, 355
  23549.  
  23550.         W
  23551.  
  23552.         Warm reboot, 303
  23553.         Warning mark, see !
  23554.         WHILE, 215
  23555.         Wildcards, 59
  23556.             and @SEARCH variable
  23557.               function, 118
  23558.             and filename completion, 42
  23559.             and renaming
  23560.               subdirectories, 308
  23561.             extended, 60
  23562.                 and DEL, 198
  23563.             in executable extensions,
  23564.               70
  23565.             in include lists, 67
  23566.             in multiple filenames, 66
  23567.         WINDOW, 357
  23568.         Windows, see also Microsoft
  23569.           Windows
  23570.             controlling state of, 136,
  23571.               160, 357
  23572.             size of, 136
  23573.             title of, 160
  23574.  
  23575.  
  23576.         -------------------------------------------------------------------
  23577.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 406
  23578.                                                             Quick Reference
  23579.         -------------------------------------------------------------------
  23580.  
  23581.  
  23582.         Quick Reference
  23583.  
  23584.  
  23585.         Internal Variables
  23586.  
  23587.         This table lists the 4DOS, 4OS2, and 4DOS/NT internal variables by
  23588.         type, with a page reference for each.
  23589.  
  23590.  
  23591.         Hardware status         _DNAME         105      Dates and times
  23592.                                 _ENV           105
  23593.         _APMAC         103      _HLOGFILE      105      _DATE          104
  23594.         _APMBATT       103      _KSTACK        105      _DAY           104
  23595.         _APMLIFE       103      _LOGFILE       105      _DOW           105
  23596.         _CPU           104      _PID           106      _DOY           105
  23597.         _KBHIT         105      _PIPE          106      _HOUR          105
  23598.         _MONITOR       106      _PPID          106      _MINUTE        105
  23599.         _NDP           106      _PTYPE         106      _MONTH         106
  23600.         _VIDEO         107      _SHELL         106      _SECOND        106
  23601.                                 _SID           106      _TIME          107
  23602.                                 _SWAPPING      106      _YEAR          107
  23603.         Operating system        _TRANSIENT     107
  23604.         and software status     _WINTITLE      107
  23605.  
  23606.         _ANSI          103                              Error codes
  23607.         _BOOT          104                              
  23608.         _CODEPAGE      104      Screen and colors       ?              102
  23609.         _COUNTRY       104                              ??             102
  23610.         _DOS           105      _BG            104      _?             102
  23611.         _DOSVER        105      _COLUMN        104      _SYSERR        107
  23612.         _DPMI          105      _COLUMNS       104
  23613.         _DV            105      _FG            105      
  23614.         _MOUSE         106      _ROW           106      Compatibility
  23615.         _WIN           107      _ROWS          106      
  23616.         _WINDIR        107                              =              102
  23617.         _WINSYSDIR     107                              +              102
  23618.         _WINVER        107      Drives and
  23619.                                 directories
  23620.                                 
  23621.         Command processor       _CWD           104
  23622.         status                  _CWDS          104
  23623.                                 _CWP           104
  23624.         _4VER          103      _CWPS          104
  23625.         _ALIAS         103      _DISK          105
  23626.         _BATCH         104      _LASTDISK      105
  23627.         _BATCHLINE     104
  23628.         _BATCHNAME     104
  23629.  
  23630.  
  23631.  
  23632.  
  23633.         -------------------------------------------------------------------
  23634.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 407
  23635.                                                             Quick Reference
  23636.         -------------------------------------------------------------------
  23637.  
  23638.  
  23639.         Variable Functions
  23640.  
  23641.         This table lists the 4DOS, 4OS2, and 4DOS/NT variable functions by
  23642.         type, with a page reference for each.
  23643.  
  23644.                                 
  23645.         System status           @FILETIME      115      Numbers and
  23646.                                 @FILEWRITE     115      arithmetic
  23647.         @DOSMEM        112      @FILEWRITEB    115      
  23648.         @EMS           112      @FINDCLOSE     115      @COMMA         111
  23649.         @EXTENDED      113      @FINDFIRST     115      @DEC           112
  23650.         @MASTER        118      @FINDNEXT      115      @EVAL          112
  23651.         @READSCR       118      @LINE          117      @INC           116
  23652.         @XMS           120      @LINES         117      @INT           117
  23653.                                 @SEARCH        118      @NUMERIC       118
  23654.                                 @TRUENAME      119      @RANDOM        118
  23655.         Drives and devices      @UNIQUE        119
  23656.         
  23657.         @CDROM         111                              Dates and times
  23658.         @DEVICE        112      File names              
  23659.         @DISKFREE      112                              @DATE          112
  23660.         @DISKTOTAL     112      @EXT           113      @MAKEAGE       117
  23661.         @DISKUSED      112      @FILENAME      114      @MAKEDATE      117
  23662.         @FSTYPE        116      @FULL          116      @MAKETIME      117
  23663.         @LABEL         117      @NAME          118      @TIME          119
  23664.         @LPT           117      @PATH          118
  23665.         @READY         118                              
  23666.         @REMOTE        118                              Utility
  23667.         @REMOVABLE     118      Strings and             
  23668.                                 characters              @ALIAS         111
  23669.                                                         @EXEC          113
  23670.         Files                   @ASCII         111      @IF            116
  23671.         @ATTRIB        111      @CHAR          111      @REXX          118
  23672.         @ALTNAME       111      @FORMAT        116      @SELECT        119
  23673.         @DESCRIPT      112      @INDEX         116      @TIMER         119
  23674.         @EXETYPE       113      @INSTR         116
  23675.         @FILEAGE       113      @LEN           117
  23676.         @FILECLOSE     113      @LOWER         117
  23677.         @FILEDATE      113      @REPEAT        118
  23678.         @FILEOPEN      114      @SUBSTR        119
  23679.         @FILEREAD      114      @TRIM          119
  23680.         @FILES         114      @UPPER         120
  23681.         @FILESEEK      114      @WORD          120
  23682.         @FILESEEKL     114
  23683.         @FILESIZE      115
  23684.         
  23685.  
  23686.  
  23687.  
  23688.  
  23689.  
  23690.         -------------------------------------------------------------------
  23691.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 408
  23692.                                                             Quick Reference
  23693.         -------------------------------------------------------------------
  23694.  
  23695.         .INI File Directives
  23696.  
  23697.         This table lists the 4DOS, 4OS2, and 4DOS/NT .INI file directives
  23698.         by type, with a page reference for each.
  23699.  
  23700.  
  23701.         Initialization          CursorOver     138      Advanced
  23702.                                 DescriptionMax 138      
  23703.         4StartPath     131      Descriptions   138         All Products
  23704.         Alias          131      EditMode       138      ClearKeyMap    148
  23705.         AutoExecPath   131      EscapeChar     138      DescriptionName148
  23706.         AutoExecParms  132      EvalMax        138      NextINIFile    148
  23707.         DirHistory     132      EvalMin        139      
  23708.         Environment    132      HistCopy       139           4DOS Only
  23709.         EnvFree        132      HistLogName    139      CritFail       148
  23710.         HelpBook       132      HistMin        139      DiskReset      149
  23711.         HelpOptions    132      HistWinColors  139      DVCleanup      149
  23712.         HelpPath       133      HistWinHeight  139      FullINT2E      149
  23713.         History        133      HistWinLeft    139      Inherit        149
  23714.         INIQuery       133      HistWinTop     140      MessageServer  149
  23715.         LocalAliases   134      HistWinWidth   140      NetwareNames   150
  23716.         LocalDirHistory134      LineInput      140      OutputBIOS     150
  23717.         LocalHistory   134      LogName        140      StackSize      150
  23718.         PauseOnError   134      NoClobber      140      SwapReopen     151
  23719.         Swapping       134      ParameterChar  140      UniqueSwapName 151
  23720.         UMBAlias       135      Printer        141      
  23721.         UMBEnvironment 136      ScreenColumns  141
  23722.         UMBDirHistory  135      ScreenRows     141      Key Mapping
  23723.         UMBHistory     136      UpperCase      141      
  23724.         UMBLoad        136                                 General Input
  23725.         WindowHeight   136                              Backspace      144
  23726.         WindowState    136      Color                   BeginLine      144
  23727.         WindowWidth    136                              Del            144
  23728.         WindowX        136      BrightBG       141      DelToBeginning 144
  23729.         WindowY        136      ColorDir       142      DelToEnd       144
  23730.                                 InputColors    142      DelWordLeft    144
  23731.                                 ListColors     142      DelWordRight   144
  23732.         Configuration           ListStatBarColors       Down           144
  23733.                                                142      EndLine        144
  23734.         AmPm           137      SelectColors   142      EraseLine      144
  23735.         ANSI           137      SelectStatBarColors     ExecLine       144
  23736.         BatchEcho      137                     142      Ins            144
  23737.         BeepFreq       137      StdColors      142      Left           144
  23738.         BeepLength     137                              NormalKey      145
  23739.         CommandSep     137                              Right          145
  23740.         CursorIns      138                              
  23741.  
  23742.  
  23743.  
  23744.  
  23745.  
  23746.  
  23747.         -------------------------------------------------------------------
  23748.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 409
  23749.                                                             Quick Reference
  23750.         -------------------------------------------------------------------
  23751.  
  23752.  
  23753.         Up             145
  23754.         WordLeft       145
  23755.         WordRight      145
  23756.  
  23757.            Command Line
  23758.               Editing
  23759.         AddFile        145
  23760.         CommandEscape  145
  23761.         DelHistory     146
  23762.         EndHistory     146
  23763.         Help           146
  23764.         NextFile       146
  23765.         NextHistory    146
  23766.         NormalEditKey  146
  23767.         PopFile        146
  23768.         PrevFile       146
  23769.         PrevHistory    146
  23770.         SaveHistory    146
  23771.  
  23772.           History Window
  23773.         DirWinOpen     146
  23774.         HistWinBegin   146
  23775.         HistWinDel     147
  23776.         HistWinEdit    147
  23777.         HistWinEnd     147
  23778.         HistWinExec    147
  23779.         HistWinOpen    147
  23780.         NormalHWinKey  147
  23781.  
  23782.                LIST
  23783.         ListFind       147
  23784.         ListHex        147
  23785.         ListHighBit    147
  23786.         ListInfo       147
  23787.         ListNext       147
  23788.         ListPrint      147
  23789.         ListWrap       147
  23790.         NormalListKey  147
  23791.  
  23792.  
  23793.  
  23794.  
  23795.  
  23796.  
  23797.  
  23798.  
  23799.  
  23800.  
  23801.  
  23802.  
  23803.  
  23804.         -------------------------------------------------------------------
  23805.         Copr. 1994, JP Software Inc.    4DOS, 4OS2, 4DOS/NT Reference / 410
  23806.